private void OnPreviewKeyDown(object sender, KeyEventArgs e) { if (e.Handled) { return; } if (m_actions == null || m_actions.Count <= 0 || IsVisible == false) { return; } if (e.Key == Key.Down) { MoveToNextAction(); e.Handled = true; } else if (e.Key == Key.Up) { MoveToPreviousAction(); e.Handled = true; } else if (e.Key == Key.Enter) { ActionBase action = list_actions.SelectedItem as ActionBase; if (!action.IsExecutable) { e.Handled = true; return; } ExecutionRequested?.Invoke(this, new ExecutionRequestedEventArgs(action)); e.Handled = true; } }
/// <summary> /// Event that is raised when the execution of an asynchronous process is requested. /// </summary> private void OnExecutionRequested(IExecuteEventArgs e) { ExecutionRequested?.Invoke(this, e); }
/// <summary> /// Lanza el evento para preparar la ejecución /// </summary> private void RaiseEventPrepareExecution() { ExecutionRequested?.Invoke(this, EventArgs.Empty); }