1313using System ;
1414using System . IO ;
1515using System . Windows ;
16+ using System . Windows . Controls ;
1617using System . Windows . Forms ;
1718using System . Windows . Input ;
1819using System . Windows . Interop ;
20+ using System . Windows . Media ;
1921using System . Windows . Navigation ;
2022using Button = System . Windows . Controls . Button ;
2123using Control = System . Windows . Controls . Control ;
24+ using ListViewItem = System . Windows . Controls . ListViewItem ;
2225using MessageBox = System . Windows . MessageBox ;
2326using TextBox = System . Windows . Controls . TextBox ;
2427using ThemeManager = ModernWpf . ThemeManager ;
@@ -44,6 +47,7 @@ public SettingWindow(IPublicAPI api, SettingWindowViewModel viewModel)
4447 }
4548
4649 #region General
50+
4751 private void OnLoaded ( object sender , RoutedEventArgs e )
4852 {
4953 RefreshMaximizeRestoreButton ( ) ;
@@ -247,6 +251,7 @@ private void OnPluginDirecotyClick(object sender, MouseButtonEventArgs e)
247251 PluginManager . API . OpenDirectory ( directory ) ;
248252 }
249253 }
254+
250255 #endregion
251256
252257 #region Proxy
@@ -307,7 +312,7 @@ private void OnPluginStoreRefreshClick(object sender, RoutedEventArgs e)
307312
308313 private void OnExternalPluginInstallClick ( object sender , RoutedEventArgs e )
309314 {
310- if ( sender is Button { DataContext : UserPlugin plugin } )
315+ if ( sender is Button { DataContext : UserPlugin plugin } )
311316 {
312317 var pluginsManagerPlugin = PluginManager . GetPluginForId ( "9f8f9b14-2518-4907-b211-35ab6290dee7" ) ;
313318 var actionKeyword = pluginsManagerPlugin . Metadata . ActionKeywords . Count == 0 ? "" : pluginsManagerPlugin . Metadata . ActionKeywords [ 0 ] ;
@@ -326,7 +331,7 @@ private void OnExternalPluginInstallClick(object sender, RoutedEventArgs e)
326331 textBox . MoveFocus ( tRequest ) ;
327332 }
328333
329- private void ColorSchemeSelectedIndexChanged ( object sender , EventArgs e )
334+ private void ColorSchemeSelectedIndexChanged ( object sender , EventArgs e )
330335 => ThemeManager . Current . ApplicationTheme = settings . ColorScheme switch
331336 {
332337 Constant . Light => ApplicationTheme . Light ,
@@ -370,5 +375,13 @@ private void Window_StateChanged(object sender, EventArgs e)
370375 RefreshMaximizeRestoreButton ( ) ;
371376 }
372377
378+ private void SelectedPluginChanged ( object sender , SelectionChangedEventArgs e )
379+ {
380+ Plugins . ScrollIntoView ( Plugins . SelectedItem ) ;
381+ }
382+ private void ItemSizeChanged ( object sender , SizeChangedEventArgs e )
383+ {
384+ Plugins . ScrollIntoView ( Plugins . SelectedItem ) ;
385+ }
373386 }
374- }
387+ }
0 commit comments