|
5 | 5 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
6 | 6 | xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
7 | 7 | xmlns:helpers="using:Files.App.Helpers" |
8 | | - xmlns:local="using:Files.App.UserControls.Settings" |
9 | 8 | xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
10 | 9 | xmlns:uc="using:Files.App.UserControls" |
11 | 10 | xmlns:vm="using:Files.App.ViewModels.Settings" |
| 11 | + xmlns:wctcontrols="using:CommunityToolkit.WinUI.Controls" |
12 | 12 | mc:Ignorable="d"> |
13 | 13 |
|
14 | 14 | <Page.Resources> |
|
40 | 40 | Text="{helpers:ResourceString Name=Display}" /> |
41 | 41 |
|
42 | 42 | <!-- Hidden Items --> |
43 | | - <local:SettingsBlockControl Title="{helpers:ResourceString Name=HiddenItems}" HorizontalAlignment="Stretch"> |
44 | | - <local:SettingsBlockControl.Icon> |
| 43 | + <wctcontrols:SettingsExpander Header="{helpers:ResourceString Name=HiddenItems}"> |
| 44 | + <wctcontrols:SettingsExpander.HeaderIcon> |
45 | 45 | <FontIcon Glyph="" /> |
46 | | - </local:SettingsBlockControl.Icon> |
47 | | - <local:SettingsBlockControl.ExpandableContent> |
48 | | - <StackPanel> |
49 | | - <!-- Hidden Files --> |
50 | | - <local:SettingsBlockControl Title="{helpers:ResourceString Name=SettingsFilesAndFoldersShowHiddenItems}" HorizontalAlignment="Stretch"> |
51 | | - <ToggleSwitch |
52 | | - AutomationProperties.Name="{helpers:ResourceString Name=SettingsFilesAndFoldersShowHiddenItems}" |
53 | | - IsOn="{x:Bind ViewModel.ShowHiddenItems, Mode=TwoWay}" |
54 | | - Style="{StaticResource RightAlignedToggleSwitchStyle}" /> |
55 | | - </local:SettingsBlockControl> |
56 | | - |
57 | | - <!-- Dots Files --> |
58 | | - <local:SettingsBlockControl Title="{helpers:ResourceString Name=ShowDotFiles}" HorizontalAlignment="Stretch"> |
59 | | - <ToggleSwitch |
60 | | - AutomationProperties.Name="{helpers:ResourceString Name=ShowDotFiles}" |
61 | | - IsOn="{x:Bind ViewModel.ShowDotFiles, Mode=TwoWay}" |
62 | | - Style="{StaticResource RightAlignedToggleSwitchStyle}" /> |
63 | | - </local:SettingsBlockControl> |
64 | | - |
65 | | - <!-- System Files --> |
66 | | - <local:SettingsBlockControl Title="{helpers:ResourceString Name=ShowProtectedSystemFiles}" HorizontalAlignment="Stretch"> |
67 | | - <ToggleSwitch |
68 | | - AutomationProperties.Name="{helpers:ResourceString Name=ShowProtectedSystemFiles}" |
69 | | - IsOn="{x:Bind ViewModel.ShowProtectedSystemFiles, Mode=TwoWay}" |
70 | | - Style="{StaticResource RightAlignedToggleSwitchStyle}" /> |
71 | | - </local:SettingsBlockControl> |
72 | | - |
73 | | - <!-- Alternate Data Streams --> |
74 | | - <local:SettingsBlockControl Title="{helpers:ResourceString Name=ShowAlternateStreams}" HorizontalAlignment="Stretch"> |
75 | | - <ToggleSwitch |
76 | | - AutomationProperties.Name="{helpers:ResourceString Name=ShowAlternateStreams}" |
77 | | - IsOn="{x:Bind ViewModel.AreAlternateStreamsVisible, Mode=TwoWay}" |
78 | | - Style="{StaticResource RightAlignedToggleSwitchStyle}" /> |
79 | | - </local:SettingsBlockControl> |
80 | | - </StackPanel> |
81 | | - </local:SettingsBlockControl.ExpandableContent> |
82 | | - </local:SettingsBlockControl> |
| 46 | + </wctcontrols:SettingsExpander.HeaderIcon> |
| 47 | + <wctcontrols:SettingsExpander.Items> |
| 48 | + <!-- Hidden Files --> |
| 49 | + <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=SettingsFilesAndFoldersShowHiddenItems}"> |
| 50 | + <ToggleSwitch |
| 51 | + AutomationProperties.Name="{helpers:ResourceString Name=SettingsFilesAndFoldersShowHiddenItems}" |
| 52 | + IsOn="{x:Bind ViewModel.ShowHiddenItems, Mode=TwoWay}" |
| 53 | + Style="{StaticResource RightAlignedToggleSwitchStyle}" /> |
| 54 | + </wctcontrols:SettingsCard> |
| 55 | + |
| 56 | + <!-- Dots Files --> |
| 57 | + <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=ShowDotFiles}"> |
| 58 | + <ToggleSwitch |
| 59 | + AutomationProperties.Name="{helpers:ResourceString Name=ShowDotFiles}" |
| 60 | + IsOn="{x:Bind ViewModel.ShowDotFiles, Mode=TwoWay}" |
| 61 | + Style="{StaticResource RightAlignedToggleSwitchStyle}" /> |
| 62 | + </wctcontrols:SettingsCard> |
| 63 | + |
| 64 | + <!-- System Files --> |
| 65 | + <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=ShowProtectedSystemFiles}"> |
| 66 | + <ToggleSwitch |
| 67 | + AutomationProperties.Name="{helpers:ResourceString Name=ShowProtectedSystemFiles}" |
| 68 | + IsOn="{x:Bind ViewModel.ShowProtectedSystemFiles, Mode=TwoWay}" |
| 69 | + Style="{StaticResource RightAlignedToggleSwitchStyle}" /> |
| 70 | + </wctcontrols:SettingsCard> |
| 71 | + |
| 72 | + <!-- Alternate Data Streams --> |
| 73 | + <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=ShowAlternateStreams}"> |
| 74 | + <ToggleSwitch |
| 75 | + AutomationProperties.Name="{helpers:ResourceString Name=ShowAlternateStreams}" |
| 76 | + IsOn="{x:Bind ViewModel.AreAlternateStreamsVisible, Mode=TwoWay}" |
| 77 | + Style="{StaticResource RightAlignedToggleSwitchStyle}" /> |
| 78 | + </wctcontrols:SettingsCard> |
| 79 | + </wctcontrols:SettingsExpander.Items> |
| 80 | + </wctcontrols:SettingsExpander> |
83 | 81 |
|
84 | 82 | <!-- File Extensions --> |
85 | | - <local:SettingsBlockControl Title="{helpers:ResourceString Name=SettingsFilesAndFoldersShowFileExtensions}" HorizontalAlignment="Stretch"> |
86 | | - <local:SettingsBlockControl.Icon> |
| 83 | + <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=SettingsFilesAndFoldersShowFileExtensions}"> |
| 84 | + <wctcontrols:SettingsCard.HeaderIcon> |
87 | 85 | <FontIcon Glyph="" /> |
88 | | - </local:SettingsBlockControl.Icon> |
| 86 | + </wctcontrols:SettingsCard.HeaderIcon> |
89 | 87 | <ToggleSwitch |
90 | 88 | AutomationProperties.Name="{helpers:ResourceString Name=SettingsFilesAndFoldersShowFileExtensions}" |
91 | 89 | IsOn="{x:Bind ViewModel.ShowFileExtensions, Mode=TwoWay}" |
92 | 90 | Style="{StaticResource RightAlignedToggleSwitchStyle}" /> |
93 | | - </local:SettingsBlockControl> |
| 91 | + </wctcontrols:SettingsCard> |
94 | 92 |
|
95 | 93 | <!-- Show Thumbnails --> |
96 | | - <local:SettingsBlockControl Title="{helpers:ResourceString Name=SettingsFilesAndFoldersShowThumbnails}" HorizontalAlignment="Stretch"> |
97 | | - <local:SettingsBlockControl.Icon> |
| 94 | + <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=SettingsFilesAndFoldersShowThumbnails}"> |
| 95 | + <wctcontrols:SettingsCard.HeaderIcon> |
98 | 96 | <FontIcon Glyph="" /> |
99 | | - </local:SettingsBlockControl.Icon> |
| 97 | + </wctcontrols:SettingsCard.HeaderIcon> |
100 | 98 | <ToggleSwitch |
101 | 99 | AutomationProperties.Name="{helpers:ResourceString Name=SettingsFilesAndFoldersShowThumbnails}" |
102 | 100 | IsOn="{x:Bind ViewModel.ShowThumbnails, Mode=TwoWay}" |
103 | 101 | Style="{StaticResource RightAlignedToggleSwitchStyle}" /> |
104 | | - </local:SettingsBlockControl> |
| 102 | + </wctcontrols:SettingsCard> |
105 | 103 |
|
106 | 104 | <!-- Show Checkboxes When Selecting Items --> |
107 | | - <local:SettingsBlockControl Title="{helpers:ResourceString Name=ShowCheckboxesWhenSelectingItems}" HorizontalAlignment="Stretch"> |
108 | | - <local:SettingsBlockControl.Icon> |
| 105 | + <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=ShowCheckboxesWhenSelectingItems}"> |
| 106 | + <wctcontrols:SettingsCard.HeaderIcon> |
109 | 107 | <FontIcon Glyph="" /> |
110 | | - </local:SettingsBlockControl.Icon> |
| 108 | + </wctcontrols:SettingsCard.HeaderIcon> |
111 | 109 | <ToggleSwitch |
112 | 110 | AutomationProperties.Name="{helpers:ResourceString Name=ShowCheckboxesWhenSelectingItems}" |
113 | 111 | IsOn="{x:Bind ViewModel.ShowCheckboxesWhenSelectingItems, Mode=TwoWay}" |
114 | 112 | Style="{StaticResource RightAlignedToggleSwitchStyle}" /> |
115 | | - </local:SettingsBlockControl> |
| 113 | + </wctcontrols:SettingsCard> |
116 | 114 |
|
117 | 115 | <!-- Behaviors --> |
118 | 116 | <TextBlock |
|
122 | 120 | Text="{helpers:ResourceString Name=Behaviors}" /> |
123 | 121 |
|
124 | 122 | <!-- Opening items --> |
125 | | - <local:SettingsBlockControl Title="{helpers:ResourceString Name=OpeningItems}" HorizontalAlignment="Stretch"> |
126 | | - <local:SettingsBlockControl.Icon> |
| 123 | + <wctcontrols:SettingsExpander Header="{helpers:ResourceString Name=OpeningItems}"> |
| 124 | + <wctcontrols:SettingsExpander.HeaderIcon> |
127 | 125 | <FontIcon Glyph="" /> |
128 | | - </local:SettingsBlockControl.Icon> |
129 | | - <local:SettingsBlockControl.ExpandableContent> |
130 | | - <StackPanel> |
131 | | - <local:SettingsBlockControl Title="{helpers:ResourceString Name=SettingsOpenItemsWithOneClick}" HorizontalAlignment="Stretch"> |
132 | | - <ToggleSwitch |
133 | | - AutomationProperties.Name="{helpers:ResourceString Name=SettingsOpenItemsWithOneClick}" |
134 | | - IsOn="{x:Bind ViewModel.OpenItemsWithOneClick, Mode=TwoWay}" |
135 | | - Style="{StaticResource RightAlignedToggleSwitchStyle}" /> |
136 | | - </local:SettingsBlockControl> |
137 | | - |
138 | | - <local:SettingsBlockControl Title="{helpers:ResourceString Name=OpenFolderWithOneClickColumnsLayout}" HorizontalAlignment="Stretch"> |
139 | | - <ToggleSwitch |
140 | | - AutomationProperties.Name="{helpers:ResourceString Name=OpenFolderWithOneClickColumnsLayout}" |
141 | | - IsOn="{x:Bind ViewModel.ColumnLayoutOpenFoldersWithOneClick, Mode=TwoWay}" |
142 | | - Style="{StaticResource RightAlignedToggleSwitchStyle}" /> |
143 | | - </local:SettingsBlockControl> |
144 | | - |
145 | | - <local:SettingsBlockControl Title="{helpers:ResourceString Name=OpenFoldersInNewTab}" HorizontalAlignment="Stretch"> |
146 | | - <ToggleSwitch |
147 | | - x:Name="OpenFoldersNewTab" |
148 | | - AutomationProperties.Name="{helpers:ResourceString Name=OpenFoldersInNewTab}" |
149 | | - IsOn="{x:Bind ViewModel.OpenFoldersNewTab, Mode=TwoWay}" |
150 | | - Style="{StaticResource RightAlignedToggleSwitchStyle}" /> |
151 | | - </local:SettingsBlockControl> |
152 | | - </StackPanel> |
153 | | - </local:SettingsBlockControl.ExpandableContent> |
154 | | - </local:SettingsBlockControl> |
| 126 | + </wctcontrols:SettingsExpander.HeaderIcon> |
| 127 | + <wctcontrols:SettingsExpander.Items> |
| 128 | + <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=SettingsOpenItemsWithOneClick}"> |
| 129 | + <ToggleSwitch |
| 130 | + AutomationProperties.Name="{helpers:ResourceString Name=SettingsOpenItemsWithOneClick}" |
| 131 | + IsOn="{x:Bind ViewModel.OpenItemsWithOneClick, Mode=TwoWay}" |
| 132 | + Style="{StaticResource RightAlignedToggleSwitchStyle}" /> |
| 133 | + </wctcontrols:SettingsCard> |
| 134 | + |
| 135 | + <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=OpenFolderWithOneClickColumnsLayout}"> |
| 136 | + <ToggleSwitch |
| 137 | + AutomationProperties.Name="{helpers:ResourceString Name=OpenFolderWithOneClickColumnsLayout}" |
| 138 | + IsOn="{x:Bind ViewModel.ColumnLayoutOpenFoldersWithOneClick, Mode=TwoWay}" |
| 139 | + Style="{StaticResource RightAlignedToggleSwitchStyle}" /> |
| 140 | + </wctcontrols:SettingsCard> |
| 141 | + |
| 142 | + <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=OpenFoldersInNewTab}"> |
| 143 | + <ToggleSwitch |
| 144 | + x:Name="OpenFoldersNewTab" |
| 145 | + AutomationProperties.Name="{helpers:ResourceString Name=OpenFoldersInNewTab}" |
| 146 | + IsOn="{x:Bind ViewModel.OpenFoldersNewTab, Mode=TwoWay}" |
| 147 | + Style="{StaticResource RightAlignedToggleSwitchStyle}" /> |
| 148 | + </wctcontrols:SettingsCard> |
| 149 | + </wctcontrols:SettingsExpander.Items> |
| 150 | + </wctcontrols:SettingsExpander> |
155 | 151 |
|
156 | 152 | <!-- Confirm Delete --> |
157 | | - <local:SettingsBlockControl Title="{helpers:ResourceString Name=ShowConfirmationWhenDeletingItems}" HorizontalAlignment="Stretch"> |
158 | | - <local:SettingsBlockControl.Icon> |
| 153 | + <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=ShowConfirmationWhenDeletingItems}"> |
| 154 | + <wctcontrols:SettingsCard.HeaderIcon> |
159 | 155 | <FontIcon Glyph="" /> |
160 | | - </local:SettingsBlockControl.Icon> |
| 156 | + </wctcontrols:SettingsCard.HeaderIcon> |
161 | 157 |
|
162 | 158 | <uc:ComboBoxEx AutomationProperties.Name="{helpers:ResourceString Name=ShowConfirmationWhenDeletingItems}" SelectedIndex="{x:Bind ViewModel.SelectedDeleteConfirmationPolicyIndex, Mode=TwoWay}"> |
163 | 159 | <ComboBoxItem Content="{helpers:ResourceString Name=Always}" /> |
164 | 160 | <ComboBoxItem Content="{helpers:ResourceString Name=PermanentDeletionOnly}" /> |
165 | 161 | <ComboBoxItem Content="{helpers:ResourceString Name=Never}" /> |
166 | 162 | </uc:ComboBoxEx> |
167 | | - </local:SettingsBlockControl> |
| 163 | + </wctcontrols:SettingsCard> |
168 | 164 |
|
169 | 165 | <!-- File Extension Warning --> |
170 | | - <local:SettingsBlockControl Title="{helpers:ResourceString Name=ShowFileExtensionWarning}" HorizontalAlignment="Stretch"> |
171 | | - <local:SettingsBlockControl.Icon> |
| 166 | + <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=ShowFileExtensionWarning}"> |
| 167 | + <wctcontrols:SettingsCard.HeaderIcon> |
172 | 168 | <FontIcon Glyph="" /> |
173 | | - </local:SettingsBlockControl.Icon> |
| 169 | + </wctcontrols:SettingsCard.HeaderIcon> |
174 | 170 |
|
175 | 171 | <ToggleSwitch |
176 | 172 | AutomationProperties.Name="{helpers:ResourceString Name=ShowFileExtensionWarning}" |
177 | 173 | IsOn="{x:Bind ViewModel.ShowFileExtensionWarning, Mode=TwoWay}" |
178 | 174 | Style="{StaticResource RightAlignedToggleSwitchStyle}" /> |
179 | | - </local:SettingsBlockControl> |
| 175 | + </wctcontrols:SettingsCard> |
180 | 176 |
|
181 | 177 | <!-- Select On Hover --> |
182 | | - <local:SettingsBlockControl Title="{helpers:ResourceString Name=SelectFilesAndFoldersOnHover}" HorizontalAlignment="Stretch"> |
183 | | - <local:SettingsBlockControl.Icon> |
| 178 | + <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=SelectFilesAndFoldersOnHover}"> |
| 179 | + <wctcontrols:SettingsCard.HeaderIcon> |
184 | 180 | <FontIcon Glyph="" /> |
185 | | - </local:SettingsBlockControl.Icon> |
| 181 | + </wctcontrols:SettingsCard.HeaderIcon> |
186 | 182 |
|
187 | 183 | <ToggleSwitch |
188 | 184 | AutomationProperties.Name="{helpers:ResourceString Name=SelectFilesAndFoldersOnHover}" |
189 | 185 | IsOn="{x:Bind ViewModel.SelectFilesOnHover, Mode=TwoWay}" |
190 | 186 | Style="{StaticResource RightAlignedToggleSwitchStyle}" /> |
191 | | - </local:SettingsBlockControl> |
| 187 | + </wctcontrols:SettingsCard> |
192 | 188 |
|
193 | 189 | <!-- Double click to go up --> |
194 | | - <local:SettingsBlockControl Title="{helpers:ResourceString Name=DoubleClickBlankSpaceToGoUp}" HorizontalAlignment="Stretch"> |
195 | | - <local:SettingsBlockControl.Icon> |
| 190 | + <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=DoubleClickBlankSpaceToGoUp}"> |
| 191 | + <wctcontrols:SettingsCard.HeaderIcon> |
196 | 192 | <FontIcon Glyph="" /> |
197 | | - </local:SettingsBlockControl.Icon> |
| 193 | + </wctcontrols:SettingsCard.HeaderIcon> |
198 | 194 |
|
199 | 195 | <ToggleSwitch |
200 | 196 | AutomationProperties.Name="{helpers:ResourceString Name=DoubleClickBlankSpaceToGoUp}" |
201 | 197 | IsOn="{x:Bind ViewModel.DoubleClickToGoUp, Mode=TwoWay}" |
202 | 198 | Style="{StaticResource RightAlignedToggleSwitchStyle}" /> |
203 | | - </local:SettingsBlockControl> |
| 199 | + </wctcontrols:SettingsCard> |
204 | 200 |
|
205 | 201 | <!-- Scroll to parent folder when navigating up --> |
206 | | - <local:SettingsBlockControl Title="{helpers:ResourceString Name=ScrollToPreviousFolderWhenNavigatingUp}" HorizontalAlignment="Stretch"> |
207 | | - <local:SettingsBlockControl.Icon> |
| 202 | + <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=ScrollToPreviousFolderWhenNavigatingUp}"> |
| 203 | + <wctcontrols:SettingsCard.HeaderIcon> |
208 | 204 | <FontIcon Glyph="" /> |
209 | | - </local:SettingsBlockControl.Icon> |
| 205 | + </wctcontrols:SettingsCard.HeaderIcon> |
210 | 206 |
|
211 | 207 | <ToggleSwitch |
212 | 208 | AutomationProperties.Name="{helpers:ResourceString Name=ScrollToPreviousFolderWhenNavigatingUp}" |
213 | 209 | IsOn="{x:Bind ViewModel.ScrollToPreviousFolderWhenNavigatingUp, Mode=TwoWay}" |
214 | 210 | Style="{StaticResource RightAlignedToggleSwitchStyle}" /> |
215 | | - </local:SettingsBlockControl> |
| 211 | + </wctcontrols:SettingsCard> |
216 | 212 |
|
217 | 213 | <!-- Calculate folder sizes --> |
218 | | - <local:SettingsBlockControl |
219 | | - Title="{helpers:ResourceString Name=CalculateFolderSizes}" |
220 | | - HorizontalAlignment="Stretch" |
221 | | - IsExpanded="True"> |
222 | | - <local:SettingsBlockControl.Icon> |
| 214 | + <wctcontrols:SettingsExpander Header="{helpers:ResourceString Name=CalculateFolderSizes}" IsExpanded="True"> |
| 215 | + <wctcontrols:SettingsExpander.HeaderIcon> |
223 | 216 | <FontIcon Glyph="" /> |
224 | | - </local:SettingsBlockControl.Icon> |
| 217 | + </wctcontrols:SettingsExpander.HeaderIcon> |
225 | 218 | <ToggleSwitch |
226 | 219 | AutomationProperties.Name="{helpers:ResourceString Name=CalculateFolderSizes}" |
227 | 220 | IsOn="{x:Bind ViewModel.CalculateFolderSizes, Mode=TwoWay}" |
228 | 221 | Style="{StaticResource RightAlignedToggleSwitchStyle}" /> |
229 | | - <local:SettingsBlockControl.ExpandableContent> |
| 222 | + <wctcontrols:SettingsExpander.Items> |
230 | 223 | <InfoBar |
231 | 224 | CornerRadius="0,0,2,2" |
232 | 225 | IsClosable="False" |
233 | 226 | IsIconVisible="True" |
234 | 227 | IsOpen="True" |
235 | 228 | Message="{helpers:ResourceString Name=ShowFolderSizesWarning}" |
236 | 229 | Severity="Warning" /> |
237 | | - </local:SettingsBlockControl.ExpandableContent> |
238 | | - </local:SettingsBlockControl> |
| 230 | + </wctcontrols:SettingsExpander.Items> |
| 231 | + </wctcontrols:SettingsExpander> |
239 | 232 | </StackPanel> |
240 | 233 | </Grid> |
241 | 234 | </Page> |
0 commit comments