diff --git a/HandheldCompanion/Managers/Hotkeys/Hotkey.cs b/HandheldCompanion/Managers/Hotkeys/Hotkey.cs index 89e3fd57e..9c2360778 100644 --- a/HandheldCompanion/Managers/Hotkeys/Hotkey.cs +++ b/HandheldCompanion/Managers/Hotkeys/Hotkey.cs @@ -347,21 +347,25 @@ public void DrawInput() private void DrawOutput() { - // update button content - switch (HasOutput()) + // UI thread (async) + Application.Current.Dispatcher.BeginInvoke(() => { - case true: - mainControl.HotkeyOutput.Content = - string.Join(", ", inputsChord.OutputKeys.Where(key => key.IsKeyDown)); - mainControl.HotkeyOutput.SetResourceReference(Control.ForegroundProperty, - "SystemControlForegroundBaseHighBrush"); - break; - case false: - mainControl.HotkeyOutput.Content = Resources.ResourceManager.GetString("InputsHotkey_fallbackOutput"); - mainControl.HotkeyOutput.SetResourceReference(Control.ForegroundProperty, - "SystemControlForegroundBaseMediumBrush"); - break; - } + // update button content + switch (HasOutput()) + { + case true: + mainControl.HotkeyOutput.Content = + string.Join(", ", inputsChord.OutputKeys.Where(key => key.IsKeyDown)); + mainControl.HotkeyOutput.SetResourceReference(Control.ForegroundProperty, + "SystemControlForegroundBaseHighBrush"); + break; + case false: + mainControl.HotkeyOutput.Content = Resources.ResourceManager.GetString("InputsHotkey_fallbackOutput"); + mainControl.HotkeyOutput.SetResourceReference(Control.ForegroundProperty, + "SystemControlForegroundBaseMediumBrush"); + break; + } + }); DrawErase(); }