File tree Expand file tree Collapse file tree 5 files changed +22
-36
lines changed
Expand file tree Collapse file tree 5 files changed +22
-36
lines changed Original file line number Diff line number Diff line change @@ -10,35 +10,31 @@ namespace HandyWinGet.ViewModels
1010 public class MainWindowViewModel : BindableBase
1111 {
1212 internal static MainWindowViewModel Instance ;
13- readonly IRegionManager region ;
13+ private readonly IRegionManager region ;
14+
15+ private NavigationViewPaneDisplayMode _paneDisplayMode ;
1416 private DelegateCommand < NavigationViewSelectionChangedEventArgs > _SwitchCommand ;
1517
18+ public MainWindowViewModel ( IRegionManager regionManager )
19+ {
20+ Instance = this ;
21+ region = regionManager ;
22+ }
23+
1624 public DelegateCommand < NavigationViewSelectionChangedEventArgs > SwitchCommand =>
1725 _SwitchCommand ?? ( _SwitchCommand = new DelegateCommand < NavigationViewSelectionChangedEventArgs > ( Switch ) ) ;
1826
19- private NavigationViewPaneDisplayMode _paneDisplayMode ;
20-
2127 public NavigationViewPaneDisplayMode PaneDisplayMode
2228 {
2329 get => GlobalDataHelper < AppConfig > . Config . PaneDisplayMode ;
2430 set => SetProperty ( ref _paneDisplayMode , value ) ;
2531 }
2632
27- public MainWindowViewModel ( IRegionManager regionManager )
28- {
29- Instance = this ;
30- region = regionManager ;
31- }
32-
3333 private void Switch ( NavigationViewSelectionChangedEventArgs e )
3434 {
3535 if ( e . SelectedItem is NavigationViewItem item )
36- {
3736 if ( item . Tag != null )
38- {
3937 region . RequestNavigate ( "ContentRegion" , item . Tag . ToString ( ) ) ;
40- }
41- }
4238 }
4339 }
4440}
Original file line number Diff line number Diff line change 33namespace HandyWinGet . Views
44{
55 /// <summary>
6- /// Interaction logic for CreatePackage
6+ /// Interaction logic for CreatePackage
77 /// </summary>
88 public partial class CreatePackage : UserControl
99 {
Original file line number Diff line number Diff line change 1- using HandyControl . Controls ;
1+ using System . Windows ;
2+ using HandyControl . Controls ;
23using HandyControl . Data ;
34using HandyWinGet . Data ;
4- using System . Windows ;
55
66namespace HandyWinGet . Views
77{
88 /// <summary>
9- /// Interaction logic for MainWindow.xaml
9+ /// Interaction logic for MainWindow.xaml
1010 /// </summary>
1111 public partial class MainWindow
1212 {
1313 public MainWindow ( )
1414 {
1515 InitializeComponent ( ) ;
1616 if ( GlobalDataHelper < AppConfig > . Config . Skin . Equals ( SkinType . Default ) )
17- {
1817 tg . IsChecked = false ;
19- }
2018 else
21- {
2219 tg . IsChecked = true ;
23- }
2420 }
2521
2622 private void ToggleSkins_OnClick ( object sender , RoutedEventArgs e )
2723 {
2824 var tag = SkinType . Default ;
2925 if ( tg . IsChecked . Value )
30- {
3126 tag = SkinType . Dark ;
32- }
3327 else
34- {
3528 tag = SkinType . Default ;
36- }
3729
38- if ( tag . Equals ( GlobalDataHelper < AppConfig > . Config . Skin ) )
39- {
40- return ;
41- }
30+ if ( tag . Equals ( GlobalDataHelper < AppConfig > . Config . Skin ) ) return ;
4231
4332 GlobalDataHelper < AppConfig > . Config . Skin = tag ;
4433 GlobalDataHelper < AppConfig > . Save ( ) ;
45- ( ( App ) System . Windows . Application . Current ) . UpdateSkin ( tag ) ;
34+ ( ( App ) Application . Current ) . UpdateSkin ( tag ) ;
4635 }
4736 }
4837}
Original file line number Diff line number Diff line change 1- using HandyControl . Controls ;
2- using HandyWinGet . Data ;
1+ using System . Windows ;
32using System . Windows . Controls ;
3+ using HandyControl . Controls ;
4+ using HandyWinGet . Data ;
45
56namespace HandyWinGet . Views
67{
78 /// <summary>
8- /// Interaction logic for Packages
9+ /// Interaction logic for Packages
910 /// </summary>
1011 public partial class Packages : UserControl
1112 {
@@ -21,8 +22,8 @@ public Packages()
2122 public void SetPublisherVisibility ( )
2223 {
2324 dg . Columns [ 0 ] . Visibility = GlobalDataHelper < AppConfig > . Config . IsShowingGroup
24- ? System . Windows . Visibility . Collapsed
25- : System . Windows . Visibility . Visible ;
25+ ? Visibility . Collapsed
26+ : Visibility . Visible ;
2627 }
2728 }
2829}
Original file line number Diff line number Diff line change 33namespace HandyWinGet . Views
44{
55 /// <summary>
6- /// Interaction logic for Settings
6+ /// Interaction logic for Settings
77 /// </summary>
88 public partial class Settings : UserControl
99 {
You can’t perform that action at this time.
0 commit comments