19
19
20
20
namespace Files . View_Models
21
21
{
22
- public class SettingsViewModel : ViewModelBase
22
+ public class SettingsViewModel : ViewModelBase
23
23
{
24
24
ApplicationDataContainer localSettings = ApplicationData . Current . LocalSettings ;
25
25
@@ -68,7 +68,7 @@ private void DetectDateTimeFormat()
68
68
}
69
69
else
70
70
{
71
- localSettings . Values [ LocalSettings . DateTimeFormat ] = "Application" ;
71
+ localSettings . Values [ LocalSettings . DateTimeFormat ] = "Application" ;
72
72
}
73
73
}
74
74
@@ -105,34 +105,34 @@ private async void DetectCustomLocations()
105
105
106
106
private void DetectApplicationTheme ( )
107
107
{
108
- if ( localSettings . Values [ "theme" ] != null )
109
- {
110
- if ( localSettings . Values [ "theme" ] . ToString ( ) == "Light" )
111
- {
112
- ThemeValue = ThemeStyle . Light ;
113
- App . Current . RequestedTheme = ApplicationTheme . Light ;
114
- return ;
115
- }
116
- else if ( localSettings . Values [ "theme" ] . ToString ( ) == "Dark" )
117
- {
118
- ThemeValue = ThemeStyle . Dark ;
119
- App . Current . RequestedTheme = ApplicationTheme . Dark ;
120
- return ;
121
- }
122
- }
123
-
124
- var uiSettings = new UISettings ( ) ;
125
- var color = uiSettings . GetColorValue ( UIColorType . Background ) ;
126
- if ( color == Colors . White )
127
- {
128
- ThemeValue = ThemeStyle . System ;
129
- App . Current . RequestedTheme = ApplicationTheme . Light ;
130
- }
131
- else
132
- {
133
- ThemeValue = ThemeStyle . System ;
134
- App . Current . RequestedTheme = ApplicationTheme . Dark ;
135
- }
108
+ if ( localSettings . Values [ "theme" ] != null )
109
+ {
110
+ if ( localSettings . Values [ "theme" ] . ToString ( ) == "Light" )
111
+ {
112
+ ThemeValue = ThemeStyle . Light ;
113
+ App . Current . RequestedTheme = ApplicationTheme . Light ;
114
+ return ;
115
+ }
116
+ else if ( localSettings . Values [ "theme" ] . ToString ( ) == "Dark" )
117
+ {
118
+ ThemeValue = ThemeStyle . Dark ;
119
+ App . Current . RequestedTheme = ApplicationTheme . Dark ;
120
+ return ;
121
+ }
122
+ }
123
+
124
+ var uiSettings = new UISettings ( ) ;
125
+ var color = uiSettings . GetColorValue ( UIColorType . Background ) ;
126
+ if ( color == Colors . White )
127
+ {
128
+ ThemeValue = ThemeStyle . System ;
129
+ App . Current . RequestedTheme = ApplicationTheme . Light ;
130
+ }
131
+ else
132
+ {
133
+ ThemeValue = ThemeStyle . System ;
134
+ App . Current . RequestedTheme = ApplicationTheme . Dark ;
135
+ }
136
136
}
137
137
138
138
private async void LoadTerminalApps ( )
@@ -162,6 +162,7 @@ private async void LoadTerminalApps()
162
162
private FormFactorMode _FormFactor = FormFactorMode . Regular ;
163
163
private ThemeStyle _ThemeValue ;
164
164
private bool _AreLinuxFilesSupported = false ;
165
+ private bool _PinOneDriveToSideBar = true ;
165
166
private bool _ShowRibbonContent = true ;
166
167
private string _DesktopPath = Environment . GetFolderPath ( Environment . SpecialFolder . DesktopDirectory ) ;
167
168
private string _DocumentsPath = Environment . GetFolderPath ( Environment . SpecialFolder . MyDocuments ) ;
@@ -189,7 +190,7 @@ public FormFactorMode FormFactor
189
190
public ThemeStyle ThemeValue
190
191
{
191
192
get => _ThemeValue ;
192
- set
193
+ set
193
194
{
194
195
Set ( ref _ThemeValue , value ) ;
195
196
if ( value . Equals ( ThemeStyle . System ) )
@@ -213,6 +214,12 @@ public bool AreLinuxFilesSupported
213
214
set => Set ( ref _AreLinuxFilesSupported , value ) ;
214
215
}
215
216
217
+ public bool PinOneDriveToSideBar
218
+ {
219
+ get => _PinOneDriveToSideBar ;
220
+ set => Set ( ref _PinOneDriveToSideBar , value ) ;
221
+ }
222
+
216
223
public string DesktopPath
217
224
{
218
225
get => _DesktopPath ;
@@ -264,7 +271,7 @@ public bool ShowRibbonContent
264
271
public SidebarOpacity SidebarThemeMode
265
272
{
266
273
get => _SidebarThemeMode ;
267
- set
274
+ set
268
275
{
269
276
Set ( ref _SidebarThemeMode , value ) ;
270
277
if ( value . Equals ( SidebarOpacity . Opaque ) )
@@ -281,7 +288,7 @@ public SidebarOpacity SidebarThemeMode
281
288
public TimeStyle DisplayedTimeStyle
282
289
{
283
290
get => _DisplayedTimeStyle ;
284
- set
291
+ set
285
292
{
286
293
Set ( ref _DisplayedTimeStyle , value ) ;
287
294
if ( value . Equals ( TimeStyle . Application ) )
@@ -303,4 +310,4 @@ public void Dispose()
303
310
DrivesManager . Dispose ( ) ;
304
311
}
305
312
}
306
- }
313
+ }
0 commit comments