1- using Flow . Launcher . Helper ;
2- using Flow . Launcher . Infrastructure . UserSettings ;
3- using System . Collections . ObjectModel ;
4- using System . ComponentModel ;
1+ using System . Collections . ObjectModel ;
52using System . Linq ;
63using System . Windows ;
74using System . Windows . Input ;
85using System . Windows . Controls ;
6+ using Flow . Launcher . Helper ;
7+ using Flow . Launcher . Infrastructure . UserSettings ;
98
109namespace Flow . Launcher
1110{
1211 public partial class CustomQueryHotkeySetting : Window
1312 {
14- private readonly Settings _settings ;
13+ public Settings Settings { get ; set ; }
14+
1515 private bool update ;
1616 private CustomPluginHotkey updateCustomHotkey ;
17- public event PropertyChangedEventHandler PropertyChanged ;
18-
19- public string SettingWindowFont
20- {
21- get => _settings . SettingWindowFont ;
22- set
23- {
24- if ( _settings . SettingWindowFont != value )
25- {
26- _settings . SettingWindowFont = value ;
27- OnPropertyChanged ( nameof ( SettingWindowFont ) ) ;
28- }
29- }
30- }
31-
32- protected virtual void OnPropertyChanged ( string propertyName )
33- {
34- PropertyChanged ? . Invoke ( this , new PropertyChangedEventArgs ( propertyName ) ) ;
35- }
17+
3618 public CustomQueryHotkeySetting ( Settings settings )
3719 {
38- _settings = settings ;
20+ Settings = settings ;
3921 InitializeComponent ( ) ;
4022 }
4123
@@ -48,13 +30,13 @@ private void btnAdd_OnClick(object sender, RoutedEventArgs e)
4830 {
4931 if ( ! update )
5032 {
51- _settings . CustomPluginHotkeys ??= new ObservableCollection < CustomPluginHotkey > ( ) ;
33+ Settings . CustomPluginHotkeys ??= new ObservableCollection < CustomPluginHotkey > ( ) ;
5234
5335 var pluginHotkey = new CustomPluginHotkey
5436 {
5537 Hotkey = HotkeyControl . CurrentHotkey . ToString ( ) , ActionKeyword = tbAction . Text
5638 } ;
57- _settings . CustomPluginHotkeys . Add ( pluginHotkey ) ;
39+ Settings . CustomPluginHotkeys . Add ( pluginHotkey ) ;
5840
5941 HotKeyMapper . SetCustomQueryHotkey ( pluginHotkey ) ;
6042 }
@@ -73,7 +55,7 @@ private void btnAdd_OnClick(object sender, RoutedEventArgs e)
7355
7456 public void UpdateItem ( CustomPluginHotkey item )
7557 {
76- updateCustomHotkey = _settings . CustomPluginHotkeys . FirstOrDefault ( o =>
58+ updateCustomHotkey = Settings . CustomPluginHotkeys . FirstOrDefault ( o =>
7759 o . ActionKeyword == item . ActionKeyword && o . Hotkey == item . Hotkey ) ;
7860 if ( updateCustomHotkey == null )
7961 {
0 commit comments