public void Execute(object?parameter)
 {
     if (CanExecute(parameter))
     {
         ExecuteRequested?.Invoke();
     }
 }
Beispiel #2
0
 private void TbEditor_PreviewKeyDown(object sender, System.Windows.Input.KeyEventArgs e)
 {
     if (e.Key == Key.Enter)
     {
         ExecuteRequested?.Invoke(this, new RoutedEventArgs());
         e.Handled = true;
     }
 }
Beispiel #3
0
        /// <summary>
        /// Defines the method to be called when the command is invoked.
        /// </summary>
        /// <param name="parameter">Data used by the command.  If the command does not require data to be passed, this object can be set to null.</param>
        public void Execute(object parameter)
        {
            var args = new ExecuteRequestedEventArgs {
                Parameter     = parameter,
                CommandParent = TargetAction
            };

            TargetAction(parameter);

            ExecuteRequested?.Invoke(parameter, args);
        }
Beispiel #4
0
 protected virtual void OnExecuteRequested()
 {
     ExecuteRequested?.Invoke();
 }
Beispiel #5
0
 protected void ExecuteCommand()
 {
     ExecuteRequested?.Invoke();
 }