private void UpdateActionDispatcher(ActionDispatcher current, ActionDispatcher previous) { if (null != previous) { previous.ExecuteAction -= OnActionDispatcherExecuteAction; } if (null != current) { current.ExecuteAction += OnActionDispatcherExecuteAction; } foreach (DialogAction action in Actions) { action.ActionDispatcher = current; } }
private void OnActionDispatcherExecuteAction(ActionDispatcher sender, DispatcherActionExecuteEventArgs e) { if (sender != ActionDispatcher) { return; } var wellKnownActions = Enum.GetValues(typeof(WellKnownActions)); foreach (WellKnownActions action in wellKnownActions) { var knownAction = ActionDispatcher.GetKnownAction(action); if (e.Action == knownAction) { Close(); } } executeAction.Invoke(this, new DialogActionExecuteEventArgs(e.Payload as IDialogAction)); }
public WellKnownAction(ActionDispatcher dispatcher, WellKnownActions action) : base(dispatcher) { Action = action; }
protected DispatchedAction(ActionDispatcher dispatcher) { this.dispatcher = dispatcher; }