Skip to content

Commit adec2b1

Browse files
committed
Properties
1 parent bf38b4b commit adec2b1

File tree

3 files changed

+59
-69
lines changed

3 files changed

+59
-69
lines changed

src/Files.App/Views/Properties/CompatibilityPage.xaml

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
88
xmlns:helpers="using:Files.App.Helpers"
99
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
10-
xmlns:settingsuc="using:Files.App.UserControls.Settings"
1110
xmlns:vm="using:Files.App.ViewModels.Properties"
11+
xmlns:wctcontrols="using:CommunityToolkit.WinUI.Controls"
1212
DataContext="{x:Bind CompatibilityViewModel, Mode=OneWay}"
1313
Loaded="Properties_Loaded"
1414
Tag="Compatibility"
@@ -30,79 +30,78 @@
3030
<StackPanel Padding="12" Spacing="4">
3131

3232
<!-- Run Troubleshooter -->
33-
<settingsuc:SettingsBlockControl
34-
Title="{helpers:ResourceString Name=CompatibilityRunTroubleshooter}"
35-
ButtonCommand="{x:Bind CompatibilityViewModel.RunTroubleshooterCommand}"
36-
IsClickable="True">
37-
<FontIcon
38-
FontSize="14"
39-
Foreground="{ThemeResource TextFillColorPrimaryBrush}"
40-
Glyph="&#xE8A7;" />
41-
</settingsuc:SettingsBlockControl>
33+
<wctcontrols:SettingsCard
34+
Command="{x:Bind CompatibilityViewModel.RunTroubleshooterCommand}"
35+
Header="{helpers:ResourceString Name=CompatibilityRunTroubleshooter}"
36+
IsClickEnabled="True">
37+
<wctcontrols:SettingsCard.ActionIcon>
38+
<FontIcon Glyph="&#xE8A7;" />
39+
</wctcontrols:SettingsCard.ActionIcon>
40+
</wctcontrols:SettingsCard>
4241

4342
<!-- Compatibility Mode -->
44-
<settingsuc:SettingsBlockControl Title="{helpers:ResourceString Name=CompatibilityMode}" HorizontalAlignment="Stretch">
43+
<wctcontrols:SettingsCard Header="{helpers:ResourceString Name=CompatibilityMode}">
4544
<ComboBox
4645
AutomationProperties.Name="{helpers:ResourceString Name=CompatibilityMode}"
4746
ItemsSource="{x:Bind CompatibilityViewModel.CompatibilityModes.Values, Mode=OneWay}"
4847
SelectedItem="{x:Bind CompatibilityViewModel.SelectedCompatibilityMode, Mode=TwoWay}" />
49-
</settingsuc:SettingsBlockControl>
48+
</wctcontrols:SettingsCard>
5049

5150
<!-- Reduce Color Mode -->
52-
<settingsuc:SettingsBlockControl Title="{helpers:ResourceString Name=CompatibilityReducedColorMode}" HorizontalAlignment="Stretch">
51+
<wctcontrols:SettingsCard Header="{helpers:ResourceString Name=CompatibilityReducedColorMode}">
5352
<ComboBox
5453
AutomationProperties.Name="{helpers:ResourceString Name=CompatibilityReducedColorMode}"
5554
ItemsSource="{x:Bind CompatibilityViewModel.ReducedColorModes.Values, Mode=OneWay}"
5655
SelectedItem="{x:Bind CompatibilityViewModel.SelectedReducedColorMode, Mode=TwoWay}" />
57-
</settingsuc:SettingsBlockControl>
56+
</wctcontrols:SettingsCard>
5857

5958
<!-- Run In Low Resolution -->
60-
<settingsuc:SettingsBlockControl Title="{helpers:ResourceString Name=CompatibilityRunIn640x480Resolution}" HorizontalAlignment="Stretch">
59+
<wctcontrols:SettingsCard Header="{helpers:ResourceString Name=CompatibilityRunIn640x480Resolution}">
6160
<ToggleSwitch
6261
AutomationProperties.Name="{helpers:ResourceString Name=CompatibilityRunIn640x480Resolution}"
6362
IsOn="{x:Bind CompatibilityViewModel.RunIn40x480Resolution, Mode=TwoWay}"
6463
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
65-
</settingsuc:SettingsBlockControl>
64+
</wctcontrols:SettingsCard>
6665

6766
<!-- Disable Full Screen Optimizations -->
68-
<settingsuc:SettingsBlockControl Title="{helpers:ResourceString Name=CompatibilityDisableFullscreenOptimizations}" HorizontalAlignment="Stretch">
67+
<wctcontrols:SettingsCard Header="{helpers:ResourceString Name=CompatibilityDisableFullscreenOptimizations}">
6968
<ToggleSwitch
7069
AutomationProperties.Name="{helpers:ResourceString Name=CompatibilityDisableFullscreenOptimizations}"
7170
IsOn="{x:Bind CompatibilityViewModel.DisableFullscreenOptimization, Mode=TwoWay}"
7271
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
73-
</settingsuc:SettingsBlockControl>
72+
</wctcontrols:SettingsCard>
7473

7574
<!-- Run As Admin -->
76-
<settingsuc:SettingsBlockControl Title="{helpers:ResourceString Name=RunAsAdministrator}" HorizontalAlignment="Stretch">
75+
<wctcontrols:SettingsCard Header="{helpers:ResourceString Name=RunAsAdministrator}">
7776
<ToggleSwitch
7877
AutomationProperties.Name="{helpers:ResourceString Name=RunAsAdministrator}"
7978
IsOn="{x:Bind CompatibilityViewModel.RunAsAdministrator, Mode=TwoWay}"
8079
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
81-
</settingsuc:SettingsBlockControl>
80+
</wctcontrols:SettingsCard>
8281

8382
<!-- Register App For Restart -->
84-
<settingsuc:SettingsBlockControl Title="{helpers:ResourceString Name=CompatibilityRegisterThisProgramForRestart}" HorizontalAlignment="Stretch">
83+
<wctcontrols:SettingsCard Header="{helpers:ResourceString Name=CompatibilityRegisterThisProgramForRestart}">
8584
<ToggleSwitch
8685
AutomationProperties.Name="{helpers:ResourceString Name=CompatibilityRegisterThisProgramForRestart}"
8786
IsOn="{x:Bind CompatibilityViewModel.RegisterForRestart, Mode=TwoWay}"
8887
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
89-
</settingsuc:SettingsBlockControl>
88+
</wctcontrols:SettingsCard>
9089

9190
<!-- High DPI Options -->
92-
<settingsuc:SettingsBlockControl Title="{helpers:ResourceString Name=CompatibilityUseDPISettings}" HorizontalAlignment="Stretch">
91+
<wctcontrols:SettingsCard Header="{helpers:ResourceString Name=CompatibilityUseDPISettings}">
9392
<ComboBox
9493
AutomationProperties.Name="{helpers:ResourceString Name=CompatibilityUseDPISettings}"
9594
ItemsSource="{x:Bind CompatibilityViewModel.HighDpiOptions.Values, Mode=OneWay}"
9695
SelectedItem="{x:Bind CompatibilityViewModel.SelectedHighDpiOption, Mode=TwoWay}" />
97-
</settingsuc:SettingsBlockControl>
96+
</wctcontrols:SettingsCard>
9897

9998
<!-- Override High DPI Scaling Behavior -->
100-
<settingsuc:SettingsBlockControl Title="{helpers:ResourceString Name=CompatibilityOverrideHighDPIBehavior}" HorizontalAlignment="Stretch">
99+
<wctcontrols:SettingsCard Header="{helpers:ResourceString Name=CompatibilityOverrideHighDPIBehavior}">
101100
<ComboBox
102101
AutomationProperties.Name="{helpers:ResourceString Name=CompatibilityOverrideHighDPIBehavior}"
103102
ItemsSource="{x:Bind CompatibilityViewModel.HighDpiOverrides.Values, Mode=OneWay}"
104103
SelectedItem="{x:Bind CompatibilityViewModel.SelectedHighDpiOverride, Mode=TwoWay}" />
105-
</settingsuc:SettingsBlockControl>
104+
</wctcontrols:SettingsCard>
106105

107106
</StackPanel>
108107
</ScrollViewer>

src/Files.App/Views/Properties/GeneralPage.xaml

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
x:Class="Files.App.Views.Properties.GeneralPage"
44
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
55
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
6-
xmlns:controls="using:Files.App.UserControls.Settings"
76
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
87
xmlns:helpers="using:Files.App.Helpers"
98
xmlns:i="using:Microsoft.Xaml.Interactivity"
109
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
1110
xmlns:toolkitconverters="using:CommunityToolkit.WinUI.Converters"
1211
xmlns:uc="using:Files.App.UserControls"
1312
xmlns:vm="using:Files.App.ViewModels.Properties"
13+
xmlns:wctcontrols="using:CommunityToolkit.WinUI.Controls"
1414
Loaded="Properties_Loaded"
1515
Tag="General"
1616
mc:Ignorable="d">
@@ -592,34 +592,28 @@
592592
</Grid>
593593

594594
<!-- Disk Cleanup -->
595-
<controls:SettingsBlockControl
595+
<wctcontrols:SettingsCard
596596
x:Name="CleanupDriveBlockControl"
597-
Title="{helpers:ResourceString Name=CleanupDrive}"
598597
x:Load="{x:Bind ViewModel.CleanupVisibility, Mode=OneWay}"
599-
ButtonCommand="{x:Bind ViewModel.CleanupDriveCommand}"
600-
IsClickable="True">
601-
602-
<FontIcon
603-
FontSize="14"
604-
Foreground="{ThemeResource TextFillColorPrimaryBrush}"
605-
Glyph="&#xE8A7;" />
606-
607-
</controls:SettingsBlockControl>
598+
Command="{x:Bind ViewModel.CleanupDriveCommand}"
599+
Header="{helpers:ResourceString Name=CleanupDrive}"
600+
IsClickEnabled="True">
601+
<wctcontrols:SettingsCard.ActionIcon>
602+
<FontIcon Glyph="&#xE8A7;" />
603+
</wctcontrols:SettingsCard.ActionIcon>
604+
</wctcontrols:SettingsCard>
608605

609606
<!-- Format Disk -->
610-
<controls:SettingsBlockControl
607+
<wctcontrols:SettingsCard
611608
x:Name="FormatDriveBlockControl"
612-
Title="{helpers:ResourceString Name=FormatDrive}"
613609
x:Load="{x:Bind ViewModel.FormatVisibility, Mode=OneWay}"
614-
ButtonCommand="{x:Bind ViewModel.FormatDriveCommand}"
615-
IsClickable="True">
616-
617-
<FontIcon
618-
FontSize="14"
619-
Foreground="{ThemeResource TextFillColorPrimaryBrush}"
620-
Glyph="&#xE8A7;" />
621-
622-
</controls:SettingsBlockControl>
610+
Command="{x:Bind ViewModel.FormatDriveCommand}"
611+
Header="{helpers:ResourceString Name=FormatDrive}"
612+
IsClickEnabled="True">
613+
<wctcontrols:SettingsCard.ActionIcon>
614+
<FontIcon Glyph="&#xE8A7;" />
615+
</wctcontrols:SettingsCard.ActionIcon>
616+
</wctcontrols:SettingsCard>
623617

624618
<!-- Security -->
625619
<Expander

src/Files.App/Views/Properties/ShortcutPage.xaml

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
77
xmlns:helpers="using:Files.App.Helpers"
88
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
9-
xmlns:settingsuc="using:Files.App.UserControls.Settings"
109
xmlns:vm="using:Files.App.ViewModels.Properties"
10+
xmlns:wctcontrols="using:CommunityToolkit.WinUI.Controls"
1111
Loaded="Properties_Loaded"
1212
Tag="Shortcut"
1313
mc:Ignorable="d">
@@ -137,38 +137,35 @@
137137
Text="{x:Bind ViewModel.ShortcutItemWorkingDirEditedValue, Mode=TwoWay}" />
138138
</Grid>
139139

140-
<settingsuc:SettingsBlockControl
140+
<wctcontrols:SettingsCard
141141
x:Name="WindowArgsSetting"
142-
Title="{helpers:ResourceString Name=StartWindow}"
143-
HorizontalAlignment="Stretch"
144-
x:Load="{x:Bind ViewModel.ShortcutItemWindowArgsVisibility, Mode=OneWay}">
142+
x:Load="{x:Bind ViewModel.ShortcutItemWindowArgsVisibility, Mode=OneWay}"
143+
Header="{helpers:ResourceString Name=StartWindow}">
145144
<ComboBox ItemsSource="{x:Bind ViewModel.ShowWindowCommandTypes.Values, Mode=OneWay}" SelectedItem="{x:Bind ViewModel.SelectedShowWindowCommand, Mode=TwoWay}" />
146-
</settingsuc:SettingsBlockControl>
145+
</wctcontrols:SettingsCard>
147146

148-
<settingsuc:SettingsBlockControl
147+
<wctcontrols:SettingsCard
149148
x:Name="RunAsAdminCheckbox"
150-
Title="{helpers:ResourceString Name=RunAsAdministrator}"
151-
HorizontalAlignment="Stretch"
152-
x:Load="{x:Bind ViewModel.RunAsAdminEnabled, Mode=OneWay}">
149+
x:Load="{x:Bind ViewModel.RunAsAdminEnabled, Mode=OneWay}"
150+
Header="{helpers:ResourceString Name=RunAsAdministrator}">
153151
<ToggleSwitch
154152
AutomationProperties.Name="{helpers:ResourceString Name=RunAsAdministrator}"
155153
IsOn="{x:Bind ViewModel.RunAsAdminEditedValue, Mode=TwoWay}"
156154
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
157-
</settingsuc:SettingsBlockControl>
155+
</wctcontrols:SettingsCard>
158156

159-
<settingsuc:SettingsBlockControl
157+
<wctcontrols:SettingsCard
160158
x:Name="OpenFileLocation"
161-
Title="{helpers:ResourceString Name=OpenFileLocation}"
162159
Grid.Row="2"
163160
Grid.Column="0"
164161
x:Load="{x:Bind ViewModel.IsSelectedItemShortcut, Mode=OneWay}"
165-
ButtonCommand="{x:Bind ViewModel.ShortcutItemOpenLinkCommand, Mode=OneWay}"
166-
IsClickable="True">
167-
<FontIcon
168-
FontSize="14"
169-
Foreground="{ThemeResource TextFillColorPrimaryBrush}"
170-
Glyph="&#xE8A7;" />
171-
</settingsuc:SettingsBlockControl>
162+
Command="{x:Bind ViewModel.ShortcutItemOpenLinkCommand, Mode=OneWay}"
163+
Header="{helpers:ResourceString Name=OpenFileLocation}"
164+
IsClickEnabled="True">
165+
<wctcontrols:SettingsCard.ActionIcon>
166+
<FontIcon Glyph="&#xE8A7;" />
167+
</wctcontrols:SettingsCard.ActionIcon>
168+
</wctcontrols:SettingsCard>
172169

173170
</StackPanel>
174171
</ScrollViewer>

0 commit comments

Comments
 (0)