Пример #1
0
 public void Execute(object?parameter)
 {
     if (CanExecute(parameter))
     {
         ExecuteRequested?.Invoke();
     }
 }
Пример #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;
     }
 }
Пример #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);
        }
Пример #4
0
 protected virtual void OnExecuteRequested()
 {
     ExecuteRequested?.Invoke();
 }
Пример #5
0
 protected void ExecuteCommand()
 {
     ExecuteRequested?.Invoke();
 }