11using HandyControl . Controls ;
22using HandyControl . Themes ;
33using HandyControl . Tools ;
4- using HandyWinget . Assets ;
54using HandyWinget . Views ;
65using ModernWpf . Controls ;
76using ModernWpf . Controls . Primitives ;
8- using nucs . JsonSettings ;
9- using nucs . JsonSettings . Autosave ;
10- using System . Diagnostics ;
117using System . Windows ;
12- using System . Windows . Controls ;
138using System . Windows . Input ;
149using System . Windows . Media ;
10+ using static HandyWinget . Assets . Helper ;
1511namespace HandyWinget
1612{
1713 public partial class MainWindow
1814 {
19- ISettings Settings = JsonSettings . Load < ISettings > ( ) . EnableAutosave ( ) ;
2015 internal static MainWindow Instance ;
2116
2217 public MainWindow ( )
@@ -46,9 +41,9 @@ public void CommandButtonsVisibility(Visibility visibility)
4641 appBarIsInstalled . Visibility = visibility ;
4742 appBarSeperator . Visibility = visibility ;
4843 }
49- private void NavigationView_SelectionChanged ( ModernWpf . Controls . NavigationView sender , ModernWpf . Controls . NavigationViewSelectionChangedEventArgs args )
44+ private void NavigationView_SelectionChanged ( NavigationView sender , NavigationViewSelectionChangedEventArgs args )
5045 {
51- var selectedItem = ( ModernWpf . Controls . NavigationViewItem ) args . SelectedItem ;
46+ var selectedItem = ( NavigationViewItem ) args . SelectedItem ;
5247 if ( selectedItem != null )
5348 {
5449 switch ( selectedItem . Tag )
@@ -94,7 +89,7 @@ private void ApplicationTheme_Click(object sender, RoutedEventArgs e)
9489
9590 if ( Settings . Accent != null )
9691 {
97- picker . SelectedBrush = new SolidColorBrush ( Helper . GetColorFromBrush ( Settings . Accent ) ) ;
92+ picker . SelectedBrush = new SolidColorBrush ( ApplicationHelper . GetColorFromBrush ( Settings . Accent ) ) ;
9893 }
9994
10095 picker . SelectedColorChanged += delegate
@@ -108,7 +103,7 @@ private void ApplicationTheme_Click(object sender, RoutedEventArgs e)
108103 }
109104 }
110105
111- private void Window_KeyDown ( object sender , System . Windows . Input . KeyEventArgs e )
106+ private void Window_KeyDown ( object sender , KeyEventArgs e )
112107 {
113108 if ( Keyboard . IsKeyDown ( Key . LeftCtrl ) && ! Keyboard . IsKeyDown ( Key . LeftShift ) && e . Key == Key . P )
114109 {
@@ -165,9 +160,8 @@ private void appBarIsInstalled_Checked(object sender, RoutedEventArgs e)
165160
166161 private void OpenFlyout ( string resourceKey , FrameworkElement element )
167162 {
168- ISettings _setting = JsonSettings . Load < ISettings > ( ) ;
169163 var cmdBarFlyout = ( CommandBarFlyout ) Resources [ resourceKey ] ;
170- var paneMode = _setting . PaneDisplayMode ;
164+ var paneMode = Settings . PaneDisplayMode ;
171165 switch ( paneMode )
172166 {
173167 case NavigationViewPaneDisplayMode . Auto :
0 commit comments