Exemplo n.º 1
0
        internal void RegisterAction(string displayName, ModelNodePath nodePath, string observableNodePath, object index, IReadOnlyCollection <IDirtiableViewModel> dirtiables, object newValue, object previousValue)
        {
            singleNodeActionRegistered = true;
            var actionItem = new ValueChangedActionItem(displayName, observableViewModelService, nodePath, observableNodePath, Identifier, index, dirtiables, modelContainer, previousValue);

            ActionStack.Add(actionItem);
            NotifyNodeChanged(observableNodePath);
        }
Exemplo n.º 2
0
        public override async Task Invoke(object parameter)
        {
            ActionStack?.BeginTransaction();
            object index;
            var    modelNode = NodePath.GetSourceNode(out index);

            if (modelNode == null)
            {
                throw new InvalidOperationException("Unable to retrieve the node on which to apply the redo operation.");
            }

            var actionItem = await NodeCommand.Execute(modelNode.Content, index, parameter, Dirtiables);

            if (actionItem != null)
            {
                ActionStack?.Add(actionItem);
            }
            ActionStack?.EndTransaction($"Executed {Name}");
        }
Exemplo n.º 3
0
 internal void RegisterAction(string observableNodePath, ViewModelActionItem actionItem)
 {
     // This must be done before adding the action item to the stack!
     NotifyNodeChanged(observableNodePath);
     ActionStack.Add(actionItem);
 }
 public virtual void Do(ActionStack pActionStack)
 {
     mId   = pActionStack.Add(this);
     mDone = true;
 }