コード例 #1
0
        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;
            }
        }
コード例 #2
0
        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));
        }
コード例 #3
0
 public WellKnownAction(ActionDispatcher dispatcher, WellKnownActions action)
     : base(dispatcher)
 {
     Action = action;
 }
コード例 #4
0
 protected DispatchedAction(ActionDispatcher dispatcher)
 {
     this.dispatcher = dispatcher;
 }