Esempio n. 1
0
        private static void OnFocusHotkeyChanged(DependencyObject target, DependencyPropertyChangedEventArgs e)
        {
            Window window = (Window)target;
            HotkeyServiceHelper helper = EnsureHotkeyServiceHelper(window);

            Hotkey oldValue = (Hotkey)e.OldValue;
            Hotkey newValue = (Hotkey)e.NewValue;

            helper.UpdateFocusKey(oldValue, newValue);
        }
        private static HotkeyServiceHelper EnsureHotkeyServiceHelper(Window window)
        {
            HotkeyServiceHelper helper = (HotkeyServiceHelper)window.GetValue(HotkeyServiceHelperPropertyKey.DependencyProperty);

            if (helper == null)
            {
                helper = new HotkeyServiceHelper(window);
                window.SetValue(HotkeyServiceHelperPropertyKey, helper);
            }

            return helper;
        }
Esempio n. 3
0
        private static HotkeyServiceHelper EnsureHotkeyServiceHelper(Window window)
        {
            HotkeyServiceHelper helper = (HotkeyServiceHelper)window.GetValue(HotkeyServiceHelperPropertyKey.DependencyProperty);

            if (helper == null)
            {
                helper = new HotkeyServiceHelper(window);
                window.SetValue(HotkeyServiceHelperPropertyKey, helper);
            }

            return(helper);
        }