@@ -30,13 +30,15 @@ public class SettingsViewModel : ViewModelBase
30
30
31
31
public SettingsViewModel ( )
32
32
{
33
+ _roamingSettings = ApplicationData . Current . RoamingSettings ;
34
+
33
35
DetectCustomLocations ( ) ;
34
36
DetectApplicationTheme ( ) ;
37
+ DetectOneDrivePreference ( ) ;
35
38
DetectDateTimeFormat ( ) ;
36
39
PinSidebarLocationItems ( ) ;
37
- DrivesManager = new DrivesManager ( ) ;
38
40
39
- _roamingSettings = ApplicationData . Current . RoamingSettings ;
41
+ DrivesManager = new DrivesManager ( ) ;
40
42
41
43
foundDrives = DrivesManager . Drives ;
42
44
//DetectWSLDistros();
@@ -370,31 +372,26 @@ public bool AreLinuxFilesSupported
370
372
set => Set ( ref _AreLinuxFilesSupported , value ) ;
371
373
}
372
374
373
- private bool _ShowConfirmDeleteDialog = true ;
374
- public bool ShowConfirmDeleteDialog
375
+ private void DetectOneDrivePreference ( )
375
376
{
376
- get => _ShowConfirmDeleteDialog ;
377
- set
377
+ if ( localSettings . Values [ "PinOneDrive" ] == null ) { localSettings . Values [ "PinOneDrive" ] = true ; }
378
+
379
+ if ( ( bool ) localSettings . Values [ "PinOneDrive" ] == true )
378
380
{
379
- if ( localSettings . Values [ "ShowConfirmDeleteDialog" ] == null )
380
- {
381
- localSettings . Values [ "ShowConfirmDeleteDialog" ] = value ;
382
- }
383
- else
384
- {
385
- if ( value != _ShowConfirmDeleteDialog )
386
- {
387
- Set ( ref _ShowConfirmDeleteDialog , value ) ;
388
- if ( value == true )
389
- {
390
- localSettings . Values [ "ShowConfirmDeleteDialog" ] = true ;
391
- }
392
- else
393
- {
394
- localSettings . Values [ "ShowConfirmDeleteDialog" ] = false ;
395
- }
396
- }
397
- }
381
+ PinOneDriveToSideBar = true ;
382
+ }
383
+ else
384
+ {
385
+ PinOneDriveToSideBar = false ;
386
+ }
387
+
388
+ try
389
+ {
390
+ StorageFolder . GetFolderFromPathAsync ( OneDrivePath ) ;
391
+ }
392
+ catch ( Exception )
393
+ {
394
+ PinOneDriveToSideBar = false ;
398
395
}
399
396
}
400
397
@@ -513,82 +510,58 @@ public string VideosPath
513
510
set => Set ( ref _VideosPath , value ) ;
514
511
}
515
512
516
- private bool _ShowRibbonContent = true ;
517
- public bool ShowRibbonContent
513
+ public bool AcrylicSidebar
518
514
{
519
- get => _ShowRibbonContent ;
520
- set
521
- {
522
- if ( localSettings . Values [ "ShowRibbonContent" ] == null )
523
- {
524
- localSettings . Values [ "ShowRibbonContent" ] = value ;
525
- }
526
- else
527
- {
528
- if ( value != _ShowRibbonContent )
529
- {
530
- Set ( ref _ShowRibbonContent , value ) ;
531
- if ( value == true )
532
- {
533
- localSettings . Values [ "ShowRibbonContent" ] = true ;
534
- }
535
- else
536
- {
537
- localSettings . Values [ "ShowRibbonContent" ] = false ;
538
- }
539
- }
540
- }
541
- }
515
+ get => Get ( false ) ;
516
+ set => Set ( value ) ;
542
517
}
543
- public string ToggleLayoutModeIcon
518
+
519
+ public bool ShowFileExtensions
544
520
{
545
- get => Get ( "" ) ; // List View;
521
+ get => Get ( true ) ;
522
+ set => Set ( value ) ;
523
+ }
524
+
525
+ public bool ShowConfirmDeleteDialog
526
+ {
527
+ get => Get ( true ) ;
546
528
set => Set ( value ) ;
547
529
}
530
+
531
+ public bool ShowRibbonContent
532
+ {
533
+ get => Get ( true ) ;
534
+ set => Set ( value ) ;
535
+ }
536
+
548
537
public Int32 LayoutMode
549
538
{
550
539
get => Get ( 0 ) ; // List View
551
540
set => Set ( value ) ;
552
541
}
553
542
543
+ public string ToggleLayoutModeIcon
544
+ {
545
+ get => Get ( "" ) ; // List View;
546
+ set => Set ( value ) ;
547
+ }
548
+
554
549
private RelayCommand toggleLayoutMode ;
555
550
public RelayCommand ToggleLayoutMode => toggleLayoutMode = new RelayCommand ( ( ) =>
556
551
{
557
552
if ( LayoutMode == 0 ) // List View
558
553
{
559
554
LayoutMode = 1 ; // Grid View
555
+
556
+ ToggleLayoutModeIcon = "" ;
560
557
}
561
- else
558
+ else //Grid View
562
559
{
563
560
LayoutMode = 0 ; // List View
564
- }
565
-
566
- UpdateToggleLayouModeIcon ( ) ;
567
- } ) ;
568
561
569
- public void UpdateToggleLayouModeIcon ( )
570
- {
571
- if ( LayoutMode == 0 ) // List View
572
- {
573
- ToggleLayoutModeIcon = "" ; // List View;
574
- }
575
- else // List View
576
- {
577
- ToggleLayoutModeIcon = "" ; // Grid View
562
+ ToggleLayoutModeIcon = "" ;
578
563
}
579
- }
580
-
581
- public bool AcrylicSidebar
582
- {
583
- get => Get ( false ) ;
584
- set => Set ( value ) ;
585
- }
586
-
587
- public bool ShowFileExtensions
588
- {
589
- get => Get ( true ) ;
590
- set => Set ( value ) ;
591
- }
564
+ } ) ;
592
565
593
566
private TimeStyle _DisplayedTimeStyle = TimeStyle . Application ;
594
567
public TimeStyle DisplayedTimeStyle
0 commit comments