Beispiel #1
0
 private void BindButton_OnClick(object sender, RoutedEventArgs e)
 {
     if (DeviceBinding.DeviceIoType.Equals(DeviceIoType.Input))
     {
         if (DeviceBinding.IsInBindMode)
         {
             return;
         }
         if (Category.HasValue)
         {
             DeviceBinding.DeviceBindingCategory = Category.Value;
         }
         DeviceBinding.EnterBindMode();
     }
     else
     {
         OpenContextMenu();
     }
 }
Beispiel #2
0
 private void BindButton_OnClick(object sender, RoutedEventArgs e)
 {
     if (e is KeyboardEventArgs && !((KeyEventArgs)e).Key.Equals(Key.Space))
     {
         e.Handled = true;
         return;
     }
     if (DeviceBinding.DeviceIoType.Equals(DeviceIoType.Input))
     {
         if (DeviceBinding.IsInBindMode)
         {
             return;
         }
         if (Category.HasValue)
         {
             DeviceBinding.DeviceBindingCategory = Category.Value;
         }
         DeviceBinding.EnterBindMode();
     }
     else
     {
         OpenContextMenu();
     }
 }