Ejemplo n.º 1
0
 private void Block_KeyDown(dynamic sender, KeyRoutedEventArgs e)
 {
     if (e.OriginalKey == VirtualKey.Enter)
     {
         var item = sender.DataContext;
         KeyUpCommand?.Execute(item);
         IsSelected = false;
     }
 }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
            }
        }