mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 02:36:19 +02:00
[Build]Use XamlStyler to check XAML formatting (#28643)
* Use XamlStyler to check XAML formatting * fix spellcheck * fix * format XAML FLS, Hosts, ImageResizer, MeasureTool, PowerRename * format XAML Peek * exclude settings XAML and make CI pass * doc
This commit is contained in:
committed by
GitHub
parent
b41dd81177
commit
6482e9b0de
@@ -1,72 +1,63 @@
|
||||
<!-- Copyright (c) Microsoft Corporation. All rights reserved. -->
|
||||
<!-- Licensed under the MIT License. See LICENSE in the project root for license information. -->
|
||||
|
||||
<!-- Copyright (c) Microsoft Corporation. All rights reserved. -->
|
||||
<!-- Licensed under the MIT License. See LICENSE in the project root for license information. -->
|
||||
|
||||
<UserControl
|
||||
x:Class="Peek.FilePreviewer.Controls.ArchiveControl"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:Peek.FilePreviewer.Controls"
|
||||
xmlns:converters="using:Peek.Common.Converters"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="using:Peek.FilePreviewer.Controls"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:models="using:Peek.FilePreviewer.Previewers.Archives.Models"
|
||||
xmlns:converters="using:Peek.Common.Converters"
|
||||
mc:Ignorable="d">
|
||||
<UserControl.Resources>
|
||||
<DataTemplate
|
||||
x:Key="DirectoryTemplate"
|
||||
x:DataType="models:ArchiveItem">
|
||||
<DataTemplate x:Key="DirectoryTemplate" x:DataType="models:ArchiveItem">
|
||||
<TreeViewItem
|
||||
AutomationProperties.Name="{x:Bind Name}"
|
||||
ItemsSource="{x:Bind Children}"
|
||||
IsExpanded="{x:Bind IsExpanded}">
|
||||
IsExpanded="{x:Bind IsExpanded}"
|
||||
ItemsSource="{x:Bind Children}">
|
||||
<Grid ColumnSpacing="10">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition Width="auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image
|
||||
Grid.Column="0"
|
||||
Width="16"
|
||||
Height="16"
|
||||
Grid.Column="0"
|
||||
Source="{x:Bind Icon}" />
|
||||
<TextBlock
|
||||
Grid.Column="1"
|
||||
Text="{x:Bind Name}" />
|
||||
<TextBlock Grid.Column="1" Text="{x:Bind Name}" />
|
||||
</Grid>
|
||||
</TreeViewItem>
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate
|
||||
x:Key="FileTemplate"
|
||||
x:DataType="models:ArchiveItem">
|
||||
<TreeViewItem
|
||||
AutomationProperties.Name="{x:Bind Name}">
|
||||
<Grid ColumnSpacing="10">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition Width="auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image
|
||||
Width="16"
|
||||
Height="16"
|
||||
Grid.Column="0"
|
||||
Source="{x:Bind Icon}" />
|
||||
<TextBlock
|
||||
Grid.Column="1"
|
||||
Text="{x:Bind Name}" />
|
||||
<TextBlock
|
||||
Grid.Column="2"
|
||||
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
||||
Text="{Binding Size, Converter={StaticResource BytesToStringConverter}}" />
|
||||
</Grid>
|
||||
</TreeViewItem>
|
||||
</DataTemplate>
|
||||
|
||||
<models:ArchiveItemTemplateSelector
|
||||
x:Key="ArchiveItemTemplateSelector"
|
||||
DirectoryTemplate="{StaticResource DirectoryTemplate}"
|
||||
FileTemplate="{StaticResource FileTemplate}" />
|
||||
|
||||
<DataTemplate x:Key="FileTemplate" x:DataType="models:ArchiveItem">
|
||||
<TreeViewItem AutomationProperties.Name="{x:Bind Name}">
|
||||
<Grid ColumnSpacing="10">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition Width="auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image
|
||||
Grid.Column="0"
|
||||
Width="16"
|
||||
Height="16"
|
||||
Source="{x:Bind Icon}" />
|
||||
<TextBlock Grid.Column="1" Text="{x:Bind Name}" />
|
||||
<TextBlock
|
||||
Grid.Column="2"
|
||||
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
||||
Text="{Binding Size, Converter={StaticResource BytesToStringConverter}}" />
|
||||
</Grid>
|
||||
</TreeViewItem>
|
||||
</DataTemplate>
|
||||
|
||||
<models:ArchiveItemTemplateSelector
|
||||
x:Key="ArchiveItemTemplateSelector"
|
||||
DirectoryTemplate="{StaticResource DirectoryTemplate}"
|
||||
FileTemplate="{StaticResource FileTemplate}" />
|
||||
|
||||
<converters:BytesToStringConverter x:Key="BytesToStringConverter" />
|
||||
</UserControl.Resources>
|
||||
@@ -75,29 +66,25 @@
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<ScrollViewer
|
||||
Grid.Row="0"
|
||||
HorizontalScrollBarVisibility="Auto">
|
||||
<ScrollViewer Grid.Row="0" HorizontalScrollBarVisibility="Auto">
|
||||
<TreeView
|
||||
x:Name="ArchivePreview"
|
||||
ItemsSource="{x:Bind Source, Mode=OneWay}"
|
||||
ItemTemplateSelector="{StaticResource ArchiveItemTemplateSelector}"
|
||||
SelectionMode="None"
|
||||
CanDragItems="False"
|
||||
CanReorderItems="False"
|
||||
CanDragItems="False" />
|
||||
ItemTemplateSelector="{StaticResource ArchiveItemTemplateSelector}"
|
||||
ItemsSource="{x:Bind Source, Mode=OneWay}"
|
||||
SelectionMode="None" />
|
||||
</ScrollViewer>
|
||||
<Border
|
||||
Grid.Row="1"
|
||||
MinWidth="300"
|
||||
Margin="16"
|
||||
HorizontalAlignment="Center"
|
||||
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
|
||||
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
|
||||
BorderThickness="1"
|
||||
CornerRadius="8"
|
||||
Margin="16"
|
||||
HorizontalAlignment="Center">
|
||||
<Grid
|
||||
ColumnSpacing="16"
|
||||
Padding="16">
|
||||
CornerRadius="8">
|
||||
<Grid Padding="16" ColumnSpacing="16">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="auto" />
|
||||
@@ -107,29 +94,29 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock
|
||||
Grid.Column="0"
|
||||
Text="{x:Bind DirectoryCount, Mode=OneWay}"
|
||||
IsTextSelectionEnabled="True"
|
||||
VerticalAlignment="Center"
|
||||
IsTextSelectionEnabled="True"
|
||||
Text="{x:Bind DirectoryCount, Mode=OneWay}"
|
||||
TextWrapping="Wrap" />
|
||||
<Border
|
||||
Grid.Column="1"
|
||||
BorderBrush="{ThemeResource TextFillColorPrimaryBrush}"
|
||||
BorderThickness="0 0 1 0" />
|
||||
BorderThickness="0,0,1,0" />
|
||||
<TextBlock
|
||||
Grid.Column="2"
|
||||
Text="{x:Bind FileCount, Mode=OneWay}"
|
||||
IsTextSelectionEnabled="True"
|
||||
VerticalAlignment="Center"
|
||||
IsTextSelectionEnabled="True"
|
||||
Text="{x:Bind FileCount, Mode=OneWay}"
|
||||
TextWrapping="Wrap" />
|
||||
<Border
|
||||
Grid.Column="3"
|
||||
BorderBrush="{ThemeResource TextFillColorPrimaryBrush}"
|
||||
BorderThickness="0 0 1 0" />
|
||||
BorderThickness="0,0,1,0" />
|
||||
<TextBlock
|
||||
Grid.Column="4"
|
||||
Text="{x:Bind Size, Mode=OneWay}"
|
||||
IsTextSelectionEnabled="True"
|
||||
VerticalAlignment="Center"
|
||||
IsTextSelectionEnabled="True"
|
||||
Text="{x:Bind Size, Mode=OneWay}"
|
||||
TextWrapping="Wrap" />
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
<!-- Copyright (c) Microsoft Corporation. All rights reserved. -->
|
||||
<!-- Licensed under the MIT License. See LICENSE in the project root for license information. -->
|
||||
<!-- Copyright (c) Microsoft Corporation. All rights reserved. -->
|
||||
<!-- Licensed under the MIT License. See LICENSE in the project root for license information. -->
|
||||
|
||||
<UserControl
|
||||
x:Class="Peek.FilePreviewer.Controls.BrowserControl"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:Peek.FilePreviewer.Controls"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:controls="using:Microsoft.UI.Xaml.Controls"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="using:Peek.FilePreviewer.Controls"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Grid>
|
||||
<controls:WebView2
|
||||
x:Name="PreviewBrowser"
|
||||
Loaded="PreviewWV2_Loaded"
|
||||
NavigationStarting="PreviewBrowser_NavigationStarting"
|
||||
NavigationCompleted="PreviewWV2_NavigationCompleted" />
|
||||
NavigationCompleted="PreviewWV2_NavigationCompleted"
|
||||
NavigationStarting="PreviewBrowser_NavigationStarting" />
|
||||
<ContentDialog
|
||||
x:Name="OpenUriDialog"
|
||||
x:Uid="OpenUriDialog"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<!-- Copyright (c) Microsoft Corporation and Contributors. -->
|
||||
<!-- Copyright (c) Microsoft Corporation and Contributors. -->
|
||||
<!-- Licensed under the MIT License. -->
|
||||
|
||||
<UserControl
|
||||
@@ -34,18 +34,18 @@
|
||||
Text="{x:Bind Source.FileName, Mode=OneWay}"
|
||||
TextTrimming="CharacterEllipsis">
|
||||
<ToolTipService.ToolTip>
|
||||
<ToolTip Content="{x:Bind Source.FileName, Mode=OneWay}"/>
|
||||
<ToolTip Content="{x:Bind Source.FileName, Mode=OneWay}" />
|
||||
</ToolTipService.ToolTip>
|
||||
</TextBlock>
|
||||
<TextBlock Text="{x:Bind FormatFileType(Source.FileType), Mode=OneWay}">
|
||||
<ToolTipService.ToolTip>
|
||||
<ToolTip Content="{x:Bind FormatFileType(Source.FileType), Mode=OneWay}"/>
|
||||
<ToolTip Content="{x:Bind FormatFileType(Source.FileType), Mode=OneWay}" />
|
||||
</ToolTipService.ToolTip>
|
||||
</TextBlock>
|
||||
<TextBlock Text="{x:Bind FormatFileSize(Source.FileSize), Mode=OneWay}"/>
|
||||
<TextBlock Text="{x:Bind FormatFileSize(Source.FileSize), Mode=OneWay}" />
|
||||
<TextBlock Text="{x:Bind FormatFileDateModified(Source.DateModified), Mode=OneWay}">
|
||||
<ToolTipService.ToolTip>
|
||||
<ToolTip Content="{x:Bind FormatFileDateModified(Source.DateModified), Mode=OneWay}"/>
|
||||
<ToolTip Content="{x:Bind FormatFileDateModified(Source.DateModified), Mode=OneWay}" />
|
||||
</ToolTipService.ToolTip>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
|
||||
@@ -53,13 +53,13 @@
|
||||
|
||||
<controls:ArchiveControl
|
||||
x:Name="ArchivePreview"
|
||||
LoadingState="{x:Bind ArchivePreviewer.State, Mode=OneWay}"
|
||||
Source="{x:Bind ArchivePreviewer.Tree, Mode=OneWay}"
|
||||
FileCount="{x:Bind ArchivePreviewer.FileCountText, Mode=OneWay}"
|
||||
DirectoryCount="{x:Bind ArchivePreviewer.DirectoryCountText, Mode=OneWay}"
|
||||
FileCount="{x:Bind ArchivePreviewer.FileCountText, Mode=OneWay}"
|
||||
LoadingState="{x:Bind ArchivePreviewer.State, Mode=OneWay}"
|
||||
Size="{x:Bind ArchivePreviewer.SizeText, Mode=OneWay}"
|
||||
Source="{x:Bind ArchivePreviewer.Tree, Mode=OneWay}"
|
||||
Visibility="{x:Bind IsPreviewVisible(ArchivePreviewer, Previewer.State), Mode=OneWay}" />
|
||||
|
||||
|
||||
<controls:UnsupportedFilePreview
|
||||
x:Name="UnsupportedFilePreview"
|
||||
LoadingState="{x:Bind UnsupportedFilePreviewer.State, Mode=OneWay}"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<!-- Copyright (c) Microsoft Corporation and Contributors. -->
|
||||
<!-- Licensed under the MIT License. -->
|
||||
<!-- Copyright (c) Microsoft Corporation and Contributors. -->
|
||||
<!-- Licensed under the MIT License. -->
|
||||
|
||||
<Application
|
||||
x:Class="Peek.UI.App"
|
||||
@@ -10,9 +10,9 @@
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
|
||||
<!-- Other merged dictionaries here -->
|
||||
<!-- Other merged dictionaries here -->
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
<!-- Other app resources here -->
|
||||
<!-- Other app resources here -->
|
||||
</ResourceDictionary>
|
||||
</Application.Resources>
|
||||
</Application>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<!-- Copyright (c) Microsoft Corporation and Contributors. -->
|
||||
<!-- Copyright (c) Microsoft Corporation and Contributors. -->
|
||||
<!-- Licensed under the MIT License. -->
|
||||
|
||||
<UserControl
|
||||
@@ -7,8 +7,8 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="using:Peek.UI.Views"
|
||||
FlowDirection="{x:Bind TitleBarFlowDirection, Mode=OneWay}"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
FlowDirection="{x:Bind TitleBarFlowDirection, Mode=OneWay}"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Grid x:Name="TitleBarRootContainer" Height="48">
|
||||
|
||||
Reference in New Issue
Block a user