private void Block_KeyDown(dynamic sender, KeyRoutedEventArgs e) { if (e.OriginalKey == VirtualKey.Enter) { var item = sender.DataContext; KeyUpCommand?.Execute(item); IsSelected = false; } }
private void KeyboardHook_KeyUp(object sender, KeyEventArgs e) { if (!isRecording || settings.pressInsteadOfUpDown) { return; } Command newCommand = new KeyUpCommand(DateTime.Now.TimeOfDay - elapsedTime, e.KeyCode); elapsedTime = DateTime.Now.TimeOfDay; onNewCommand?.Invoke(newCommand); }
private void TextBoxObject_KeyUp(object sender, Windows.UI.Xaml.Input.KeyRoutedEventArgs e) { var binding = TextBoxObject.GetBindingExpression(TextBox.TextProperty); binding.UpdateSource(); if (KeyUpCommand != null && KeyUpCommand.CanExecute(TextBoxObject.DataContext)) { KeyUpCommand.Execute(TextBoxObject.DataContext); } }