示例#1
0
        // Assign or unassign the `listeningEditor` from this UserControl
        private void AssignButton_Click(object sender, RoutedEventArgs e)
        {
            var assigning = listeningEditor != this;

            listeningEditor?.UpdateButtonText(false);
            UpdateButtonText(assigning);
            listeningEditor = assigning ? this : null;
        }
示例#2
0
 private static void InputEvents_KeyDown(object sender, SharpDX.RawInput.KeyboardInputEventArgs e)
 {
     if (listeningEditor != null)
     {
         listeningEditor.Dispatcher.Invoke(() => {
             listeningEditor.SelectedKey = e.Key;
             listeningEditor.UpdateButtonText(false);
             listeningEditor = null;
         });
     }
 }