14
14
using Newtonsoft . Json ;
15
15
using Files . DataModels ;
16
16
using System . Diagnostics ;
17
+ using GalaSoft . MvvmLight . Command ;
17
18
18
19
namespace Files . View_Models
19
20
{
@@ -392,40 +393,23 @@ private async void LoadTerminalApps()
392
393
Terminals = terminals ;
393
394
}
394
395
395
- private FormFactorMode _FormFactor = FormFactorMode . Regular ;
396
- private ThemeStyle _ThemeValue ;
397
- private bool _AreLinuxFilesSupported = false ;
398
- private bool _PinOneDriveToSideBar = true ;
399
- private bool _ShowRibbonContent = true ;
400
- private bool _ShowFileExtensions = true ;
401
- private string _DesktopPath = Environment . GetFolderPath ( Environment . SpecialFolder . DesktopDirectory ) ;
402
- private string _DocumentsPath = Environment . GetFolderPath ( Environment . SpecialFolder . MyDocuments ) ;
403
- private string _DownloadsPath = Environment . GetFolderPath ( Environment . SpecialFolder . UserProfile ) + @"\Downloads" ;
404
- private string _OneDrivePath = Environment . GetEnvironmentVariable ( "OneDrive" ) ;
405
- private string _PicturesPath = Environment . GetFolderPath ( Environment . SpecialFolder . MyPictures ) ;
406
- private string _MusicPath = Environment . GetFolderPath ( Environment . SpecialFolder . MyMusic ) ;
407
- private string _VideosPath = Environment . GetFolderPath ( Environment . SpecialFolder . MyVideos ) ;
408
- private string _TempPath = ( string ) Microsoft . Win32 . Registry . GetValue ( @"HKEY_CURRENT_USER\Environment" , "TEMP" , null ) ;
409
- private string _AppDataPath = Environment . GetFolderPath ( Environment . SpecialFolder . ApplicationData ) ;
410
- private string _HomePath = Environment . GetFolderPath ( Environment . SpecialFolder . UserProfile ) ;
411
- private string _WinDirPath = Environment . GetFolderPath ( Environment . SpecialFolder . Windows ) ;
412
- private bool _ShowConfirmDeleteDialog = true ;
413
396
private SidebarOpacity _SidebarThemeMode = SidebarOpacity . Opaque ;
414
- private TimeStyle _DisplayedTimeStyle = TimeStyle . Application ;
397
+
415
398
private IList < TerminalModel > _Terminals = null ;
416
-
417
399
public IList < TerminalModel > Terminals
418
400
{
419
401
get => _Terminals ;
420
402
set => Set ( ref _Terminals , value ) ;
421
403
}
422
404
405
+ private FormFactorMode _FormFactor = FormFactorMode . Regular ;
423
406
public FormFactorMode FormFactor
424
407
{
425
408
get => _FormFactor ;
426
409
set => Set ( ref _FormFactor , value ) ;
427
410
}
428
411
412
+ private ThemeStyle _ThemeValue ;
429
413
public ThemeStyle ThemeValue
430
414
{
431
415
get => _ThemeValue ;
@@ -447,12 +431,14 @@ public ThemeStyle ThemeValue
447
431
}
448
432
}
449
433
434
+ private bool _AreLinuxFilesSupported = false ;
450
435
public bool AreLinuxFilesSupported
451
436
{
452
437
get => _AreLinuxFilesSupported ;
453
438
set => Set ( ref _AreLinuxFilesSupported , value ) ;
454
439
}
455
440
441
+ private bool _ShowFileExtensions = true ;
456
442
public bool ShowFileExtensions
457
443
{
458
444
get => _ShowFileExtensions ;
@@ -480,6 +466,7 @@ public bool ShowFileExtensions
480
466
}
481
467
}
482
468
469
+ private bool _ShowConfirmDeleteDialog = true ;
483
470
public bool ShowConfirmDeleteDialog
484
471
{
485
472
get => _ShowConfirmDeleteDialog ;
@@ -507,6 +494,7 @@ public bool ShowConfirmDeleteDialog
507
494
}
508
495
}
509
496
497
+ private bool _PinOneDriveToSideBar = true ;
510
498
public bool PinOneDriveToSideBar
511
499
{
512
500
get => _PinOneDriveToSideBar ;
@@ -544,72 +532,84 @@ public bool PinOneDriveToSideBar
544
532
}
545
533
}
546
534
535
+ private string _TempPath = ( string ) Microsoft . Win32 . Registry . GetValue ( @"HKEY_CURRENT_USER\Environment" , "TEMP" , null ) ;
547
536
public string TempPath
548
537
{
549
538
get => _TempPath ;
550
539
set => Set ( ref _TempPath , value ) ;
551
540
}
552
541
542
+ private string _AppDataPath = Environment . GetFolderPath ( Environment . SpecialFolder . ApplicationData ) ;
553
543
public string AppDataPath
554
544
{
555
545
get => _AppDataPath ;
556
546
set => Set ( ref _AppDataPath , value ) ;
557
547
}
558
548
549
+ private string _HomePath = Environment . GetFolderPath ( Environment . SpecialFolder . UserProfile ) ;
559
550
public string HomePath
560
551
{
561
552
get => _HomePath ;
562
553
set => Set ( ref _HomePath , value ) ;
563
554
}
564
555
556
+ private string _WinDirPath = Environment . GetFolderPath ( Environment . SpecialFolder . Windows ) ;
565
557
public string WinDirPath
566
558
{
567
559
get => _WinDirPath ;
568
560
set => Set ( ref _WinDirPath , value ) ;
569
561
}
570
562
563
+ private string _DesktopPath = Environment . GetFolderPath ( Environment . SpecialFolder . DesktopDirectory ) ;
571
564
public string DesktopPath
572
565
{
573
566
get => _DesktopPath ;
574
567
set => Set ( ref _DesktopPath , value ) ;
575
568
}
576
569
570
+ private string _DocumentsPath = Environment . GetFolderPath ( Environment . SpecialFolder . MyDocuments ) ;
577
571
public string DocumentsPath
578
572
{
579
573
get => _DocumentsPath ;
580
574
set => Set ( ref _DocumentsPath , value ) ;
581
575
}
582
576
577
+ private string _DownloadsPath = Environment . GetFolderPath ( Environment . SpecialFolder . UserProfile ) + @"\Downloads" ;
583
578
public string DownloadsPath
584
579
{
585
580
get => _DownloadsPath ;
586
581
set => Set ( ref _DownloadsPath , value ) ;
587
582
}
588
583
584
+ private string _OneDrivePath = Environment . GetEnvironmentVariable ( "OneDrive" ) ;
589
585
public string OneDrivePath
590
586
{
591
587
get => _OneDrivePath ;
592
588
set => Set ( ref _OneDrivePath , value ) ;
593
589
}
594
590
591
+ private string _PicturesPath = Environment . GetFolderPath ( Environment . SpecialFolder . MyPictures ) ;
595
592
public string PicturesPath
596
593
{
597
594
get => _PicturesPath ;
598
595
set => Set ( ref _PicturesPath , value ) ;
599
596
}
600
597
598
+ private string _MusicPath = Environment . GetFolderPath ( Environment . SpecialFolder . MyMusic ) ;
601
599
public string MusicPath
602
600
{
603
601
get => _MusicPath ;
604
602
set => Set ( ref _MusicPath , value ) ;
605
603
}
606
604
605
+ private string _VideosPath = Environment . GetFolderPath ( Environment . SpecialFolder . MyVideos ) ;
607
606
public string VideosPath
608
607
{
609
608
get => _VideosPath ;
610
609
set => Set ( ref _VideosPath , value ) ;
611
610
}
612
611
612
+ private bool _ShowRibbonContent = true ;
613
613
public bool ShowRibbonContent
614
614
{
615
615
get => _ShowRibbonContent ;
@@ -637,6 +637,47 @@ public bool ShowRibbonContent
637
637
}
638
638
}
639
639
640
+ private string _ToggleLayoutModeIcon = "" ; // Grid View
641
+ public string ToggleLayoutModeIcon
642
+ {
643
+ get => _ToggleLayoutModeIcon ;
644
+ set => Set ( ref _ToggleLayoutModeIcon , value ) ;
645
+ }
646
+
647
+ private Int16 _LayoutMode = 0 ; // Grid View
648
+ public Int16 LayoutMode
649
+ {
650
+ get => _LayoutMode ;
651
+ set => Set ( ref _LayoutMode , value ) ;
652
+ }
653
+
654
+ private RelayCommand toggleLayoutMode ;
655
+ public RelayCommand ToggleLayoutMode => toggleLayoutMode = new RelayCommand ( ( ) =>
656
+ {
657
+ if ( LayoutMode == 0 ) // Grid View
658
+ {
659
+ LayoutMode = 1 ; // List View
660
+ }
661
+ else
662
+ {
663
+ LayoutMode = 0 ; // Grid View
664
+ }
665
+
666
+ UpdateToggleLayouModeIcon ( ) ;
667
+ } ) ;
668
+
669
+ public void UpdateToggleLayouModeIcon ( )
670
+ {
671
+ if ( LayoutMode == 0 ) // Grid View
672
+ {
673
+ ToggleLayoutModeIcon = "" ; // Grid View;
674
+ }
675
+ else // List View
676
+ {
677
+ ToggleLayoutModeIcon = "" ; // List View
678
+ }
679
+ }
680
+
640
681
public SidebarOpacity SidebarThemeMode
641
682
{
642
683
get => _SidebarThemeMode ;
@@ -654,6 +695,7 @@ public SidebarOpacity SidebarThemeMode
654
695
}
655
696
}
656
697
698
+ private TimeStyle _DisplayedTimeStyle = TimeStyle . Application ;
657
699
public TimeStyle DisplayedTimeStyle
658
700
{
659
701
get => _DisplayedTimeStyle ;
0 commit comments