|
7 | 7 | xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
8 | 8 | xmlns:helpers="using:Files.App.Helpers" |
9 | 9 | xmlns:i="using:Microsoft.Xaml.Interactivity" |
10 | | - xmlns:local="using:Files.App.UserControls.Settings" |
11 | 10 | xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
12 | 11 | xmlns:vm="using:Files.App.ViewModels.Settings" |
| 12 | + xmlns:wctcontrols="using:CommunityToolkit.WinUI.Controls" |
13 | 13 | mc:Ignorable="d"> |
14 | 14 |
|
15 | 15 | <Page.Resources> |
|
40 | 40 | Text="{helpers:ResourceString Name=Advanced}" /> |
41 | 41 |
|
42 | 42 | <!-- Export --> |
43 | | - <local:SettingsBlockControl |
44 | | - Title="{helpers:ResourceString Name=ExportSettings}" |
45 | | - ButtonCommand="{x:Bind ViewModel.ExportSettingsCommand}" |
46 | | - IsClickable="True"> |
47 | | - <local:SettingsBlockControl.Icon> |
| 43 | + <wctcontrols:SettingsCard |
| 44 | + Command="{x:Bind ViewModel.ExportSettingsCommand}" |
| 45 | + Header="{helpers:ResourceString Name=ExportSettings}" |
| 46 | + IsClickEnabled="True"> |
| 47 | + <wctcontrols:SettingsCard.HeaderIcon> |
48 | 48 | <FontIcon Glyph="" /> |
49 | | - </local:SettingsBlockControl.Icon> |
50 | | - <FontIcon |
51 | | - FontSize="14" |
52 | | - Foreground="{ThemeResource TextFillColorPrimaryBrush}" |
53 | | - Glyph="" /> |
54 | | - </local:SettingsBlockControl> |
| 49 | + </wctcontrols:SettingsCard.HeaderIcon> |
| 50 | + <wctcontrols:SettingsCard.ActionIcon> |
| 51 | + <FontIcon Glyph="" /> |
| 52 | + </wctcontrols:SettingsCard.ActionIcon> |
| 53 | + </wctcontrols:SettingsCard> |
55 | 54 |
|
56 | 55 | <!-- Import --> |
57 | | - <local:SettingsBlockControl |
58 | | - Title="{helpers:ResourceString Name=ImportSettings}" |
59 | | - ButtonCommand="{x:Bind ViewModel.ImportSettingsCommand}" |
60 | | - IsClickable="True"> |
61 | | - <local:SettingsBlockControl.Icon> |
| 56 | + <wctcontrols:SettingsCard |
| 57 | + Command="{x:Bind ViewModel.ImportSettingsCommand}" |
| 58 | + Header="{helpers:ResourceString Name=ImportSettings}" |
| 59 | + IsClickEnabled="True"> |
| 60 | + <wctcontrols:SettingsCard.HeaderIcon> |
62 | 61 | <FontIcon Glyph="" /> |
63 | | - </local:SettingsBlockControl.Icon> |
64 | | - <FontIcon |
65 | | - FontSize="14" |
66 | | - Foreground="{ThemeResource TextFillColorPrimaryBrush}" |
67 | | - Glyph="" /> |
68 | | - </local:SettingsBlockControl> |
| 62 | + </wctcontrols:SettingsCard.HeaderIcon> |
| 63 | + <wctcontrols:SettingsCard.ActionIcon> |
| 64 | + <FontIcon Glyph="" /> |
| 65 | + </wctcontrols:SettingsCard.ActionIcon> |
| 66 | + </wctcontrols:SettingsCard> |
69 | 67 |
|
70 | 68 | <!-- Edit Settings File --> |
71 | | - <local:SettingsBlockControl |
72 | | - Title="{helpers:ResourceString Name=EditSettingsFile}" |
73 | | - ButtonCommand="{x:Bind ViewModel.OpenSettingsJsonCommand}" |
74 | | - IsClickable="True"> |
75 | | - <local:SettingsBlockControl.Icon> |
| 69 | + <wctcontrols:SettingsCard |
| 70 | + Command="{x:Bind ViewModel.OpenSettingsJsonCommand}" |
| 71 | + Header="{helpers:ResourceString Name=EditSettingsFile}" |
| 72 | + IsClickEnabled="True"> |
| 73 | + <wctcontrols:SettingsCard.HeaderIcon> |
76 | 74 | <FontIcon Glyph="" /> |
77 | | - </local:SettingsBlockControl.Icon> |
78 | | - <FontIcon |
79 | | - FontSize="14" |
80 | | - Foreground="{ThemeResource TextFillColorPrimaryBrush}" |
81 | | - Glyph="" /> |
82 | | - </local:SettingsBlockControl> |
| 75 | + </wctcontrols:SettingsCard.HeaderIcon> |
| 76 | + <wctcontrols:SettingsCard.ActionIcon> |
| 77 | + <FontIcon Glyph="" /> |
| 78 | + </wctcontrols:SettingsCard.ActionIcon> |
| 79 | + </wctcontrols:SettingsCard> |
83 | 80 |
|
84 | 81 | <!-- Open on Windows startup --> |
85 | 82 | <StackPanel> |
|
94 | 91 | Severity="Warning" /> |
95 | 92 |
|
96 | 93 | <!-- Setting block --> |
97 | | - <local:SettingsBlockControl Title="{helpers:ResourceString Name=SettingsOpenInLogin}" HorizontalAlignment="Stretch"> |
98 | | - <local:SettingsBlockControl.Icon> |
| 94 | + <wctcontrols:SettingsCard HorizontalAlignment="Stretch" Header="{helpers:ResourceString Name=SettingsOpenInLogin}"> |
| 95 | + <wctcontrols:SettingsCard.HeaderIcon> |
99 | 96 | <FontIcon Glyph="" /> |
100 | | - </local:SettingsBlockControl.Icon> |
| 97 | + </wctcontrols:SettingsCard.HeaderIcon> |
101 | 98 | <ToggleSwitch |
102 | 99 | AutomationProperties.Name="{helpers:ResourceString Name=SettingsOpenInLogin}" |
103 | 100 | IsEnabled="{x:Bind ViewModel.CanOpenOnWindowsStartup, Mode=OneWay}" |
|
109 | 106 | </i:EventTriggerBehavior> |
110 | 107 | </i:Interaction.Behaviors> |
111 | 108 | </ToggleSwitch> |
112 | | - </local:SettingsBlockControl> |
| 109 | + </wctcontrols:SettingsCard> |
113 | 110 | </StackPanel> |
114 | 111 |
|
115 | 112 | <!-- Leave App Running --> |
116 | | - <local:SettingsBlockControl Title="{helpers:ResourceString Name=SettingsLeaveAppRunning}" HorizontalAlignment="Stretch"> |
117 | | - <local:SettingsBlockControl.Icon> |
| 113 | + <wctcontrols:SettingsCard HorizontalAlignment="Stretch" Header="{helpers:ResourceString Name=SettingsLeaveAppRunning}"> |
| 114 | + <wctcontrols:SettingsCard.HeaderIcon> |
118 | 115 | <FontIcon Glyph="" /> |
119 | | - </local:SettingsBlockControl.Icon> |
| 116 | + </wctcontrols:SettingsCard.HeaderIcon> |
120 | 117 | <ToggleSwitch |
121 | 118 | AutomationProperties.Name="{helpers:ResourceString Name=SettingsLeaveAppRunning}" |
122 | 119 | IsOn="{x:Bind ViewModel.LeaveAppRunning, Mode=TwoWay}" |
123 | 120 | Style="{StaticResource RightAlignedToggleSwitchStyle}" /> |
124 | | - </local:SettingsBlockControl> |
| 121 | + </wctcontrols:SettingsCard> |
125 | 122 |
|
126 | 123 | <!-- System Tray Icon --> |
127 | | - <local:SettingsBlockControl Title="{helpers:ResourceString Name=ShowSystemTrayIcon}" HorizontalAlignment="Stretch"> |
128 | | - <local:SettingsBlockControl.Icon> |
| 124 | + <wctcontrols:SettingsCard HorizontalAlignment="Stretch" Header="{helpers:ResourceString Name=ShowSystemTrayIcon}"> |
| 125 | + <wctcontrols:SettingsCard.HeaderIcon> |
129 | 126 | <FontIcon Glyph="" /> |
130 | | - </local:SettingsBlockControl.Icon> |
| 127 | + </wctcontrols:SettingsCard.HeaderIcon> |
131 | 128 | <ToggleSwitch |
132 | 129 | AutomationProperties.Name="{helpers:ResourceString Name=ShowSystemTrayIcon}" |
133 | 130 | IsOn="{x:Bind ViewModel.ShowSystemTrayIcon, Mode=TwoWay}" |
134 | 131 | Style="{StaticResource RightAlignedToggleSwitchStyle}" /> |
135 | | - </local:SettingsBlockControl> |
| 132 | + </wctcontrols:SettingsCard> |
136 | 133 |
|
137 | 134 | <!-- Experimental Settings --> |
138 | 135 | <TextBlock |
|
142 | 139 | Text="{helpers:ResourceString Name=ExperimentalFeatureFlags}" /> |
143 | 140 |
|
144 | 141 | <!-- Replace File Explorer --> |
145 | | - <local:SettingsBlockControl |
| 142 | + <wctcontrols:SettingsCard |
146 | 143 | x:Name="SetAsDefaultSettingsBlockControl" |
147 | | - Title="{helpers:ResourceString Name=SettingsSetAsDefaultFileManager}" |
148 | 144 | HorizontalAlignment="Stretch" |
149 | 145 | Description="{helpers:ResourceString Name=SettingsSetAsDefaultFileManagerDescription}" |
150 | | - IsExpanded="True"> |
151 | | - <local:SettingsBlockControl.Icon> |
| 146 | + Header="{helpers:ResourceString Name=SettingsSetAsDefaultFileManager}"> |
| 147 | + <wctcontrols:SettingsCard.HeaderIcon> |
152 | 148 | <FontIcon Glyph="" /> |
153 | | - </local:SettingsBlockControl.Icon> |
| 149 | + </wctcontrols:SettingsCard.HeaderIcon> |
154 | 150 | <ToggleSwitch |
155 | 151 | AutomationProperties.Name="{helpers:ResourceString Name=SettingsSetAsDefaultFileManager}" |
156 | 152 | IsOn="{x:Bind ViewModel.IsSetAsDefaultFileManager, Mode=TwoWay}" |
|
161 | 157 | </i:EventTriggerBehavior> |
162 | 158 | </i:Interaction.Behaviors> |
163 | 159 | </ToggleSwitch> |
164 | | - </local:SettingsBlockControl> |
| 160 | + </wctcontrols:SettingsCard> |
165 | 161 |
|
166 | 162 | <!-- Replace Open File Dialog --> |
167 | | - <local:SettingsBlockControl |
| 163 | + <wctcontrols:SettingsCard |
168 | 164 | x:Name="ReplaceOpenFileDialogSetting" |
169 | | - Title="{helpers:ResourceString Name=SettingsSetAsOpenDialog}" |
170 | 165 | HorizontalAlignment="Stretch" |
171 | | - x:Load="{x:Bind ViewModel.IsAppEnvironmentDev}"> |
172 | | - <local:SettingsBlockControl.Icon> |
| 166 | + x:Load="{x:Bind ViewModel.IsAppEnvironmentDev}" |
| 167 | + Header="{helpers:ResourceString Name=SettingsSetAsOpenDialog}"> |
| 168 | + <wctcontrols:SettingsCard.HeaderIcon> |
173 | 169 | <FontIcon Glyph="" /> |
174 | | - </local:SettingsBlockControl.Icon> |
| 170 | + </wctcontrols:SettingsCard.HeaderIcon> |
175 | 171 | <ToggleSwitch |
176 | 172 | IsEnabled="{x:Bind ViewModel.IsSetAsDefaultFileManager, Mode=OneWay}" |
177 | 173 | IsOn="{x:Bind ViewModel.IsSetAsOpenFileDialog, Mode=TwoWay}" |
|
182 | 178 | </i:EventTriggerBehavior> |
183 | 179 | </i:Interaction.Behaviors> |
184 | 180 | </ToggleSwitch> |
185 | | - </local:SettingsBlockControl> |
| 181 | + </wctcontrols:SettingsCard> |
186 | 182 |
|
187 | 183 | <!-- Flatten options --> |
188 | | - <local:SettingsBlockControl |
189 | | - Title="{helpers:ResourceString Name=ShowFlattenOptions}" |
| 184 | + <wctcontrols:SettingsCard |
190 | 185 | HorizontalAlignment="Stretch" |
191 | | - Description="{helpers:ResourceString Name=ShowFlattenOptionsDescription}"> |
192 | | - <local:SettingsBlockControl.Icon> |
| 186 | + Description="{helpers:ResourceString Name=ShowFlattenOptionsDescription}" |
| 187 | + Header="{helpers:ResourceString Name=ShowFlattenOptions}"> |
| 188 | + <wctcontrols:SettingsCard.HeaderIcon> |
193 | 189 | <FontIcon Glyph="" /> |
194 | | - </local:SettingsBlockControl.Icon> |
| 190 | + </wctcontrols:SettingsCard.HeaderIcon> |
195 | 191 | <ToggleSwitch |
196 | 192 | AutomationProperties.Name="{helpers:ResourceString Name=ShowFlattenOptions}" |
197 | 193 | IsOn="{x:Bind ViewModel.ShowFlattenOptions, Mode=TwoWay}" |
198 | 194 | Style="{StaticResource RightAlignedToggleSwitchStyle}" /> |
199 | | - </local:SettingsBlockControl> |
| 195 | + </wctcontrols:SettingsCard> |
200 | 196 | </StackPanel> |
201 | 197 | </Grid> |
202 | 198 | </Page> |
0 commit comments