diff --git a/Flow.Launcher/CustomQueryHotkeySetting.xaml b/Flow.Launcher/CustomQueryHotkeySetting.xaml index 1113cb24d..c470be903 100644 --- a/Flow.Launcher/CustomQueryHotkeySetting.xaml +++ b/Flow.Launcher/CustomQueryHotkeySetting.xaml @@ -2,6 +2,7 @@ x:Class="Flow.Launcher.CustomQueryHotkeySetting" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:flowlauncher="clr-namespace:Flow.Launcher" Title="{DynamicResource customeQueryHotkeyTitle}" Width="530" @@ -11,7 +12,8 @@ MouseDown="window_MouseDown" ResizeMode="NoResize" SizeToContent="Height" - WindowStartupLocation="CenterScreen"> + WindowStartupLocation="CenterScreen" + DataContext="{Binding RelativeSource={RelativeSource Self}}"> @@ -104,7 +106,7 @@ Grid.Column="1" Orientation="Horizontal"> o.ActionKeyword == item.ActionKeyword && o.Hotkey == item.Hotkey); + updateCustomHotkey = _settings.CustomPluginHotkeys.FirstOrDefault(o => + o.ActionKeyword == item.ActionKeyword && o.Hotkey == item.Hotkey); if (updateCustomHotkey == null) { MessageBox.Show(InternationalizationManager.Instance.GetTranslation("invalidPluginHotkey")); @@ -81,7 +86,7 @@ namespace Flow.Launcher } tbAction.Text = updateCustomHotkey.ActionKeyword; - _ = ctlHotkey.SetHotkeyAsync(updateCustomHotkey.Hotkey, false); + _ = HotkeyControlViewModel.SetHotkeyAsync(updateCustomHotkey.Hotkey, false); update = true; lblAdd.Text = InternationalizationManager.Instance.GetTranslation("update"); } diff --git a/Flow.Launcher/HotkeyControl.xaml b/Flow.Launcher/HotkeyControl.xaml index 26d9d2cea..864e9d648 100644 --- a/Flow.Launcher/HotkeyControl.xaml +++ b/Flow.Launcher/HotkeyControl.xaml @@ -5,8 +5,10 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:input="clr-namespace:System.Windows.Input;assembly=PresentationCore" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:vm="clr-namespace:Flow.Launcher.ViewModel" d:DesignWidth="300" - mc:Ignorable="d"> + mc:Ignorable="d" + d:DataContext="{d:DesignInstance vm:HotkeyControlViewModel}"> + KeyboardNavigation.TabNavigation="Continue" + IsChecked="{Binding Recording}"> @@ -62,9 +65,9 @@ BorderThickness="1" CornerRadius="5"> -