public static void SetProperty(ActionManager actionManager, IValueProvider valueProvider, object value) { SetPropertyAction action = new SetPropertyAction(valueProvider, value); if (actionManager == null) { action.Execute(); } else { actionManager.RecordAction(action); } }
public override bool TryToMerge(IAction followingAction) { SetPropertyAction next = followingAction as SetPropertyAction; // Comparing the Property does not allow for proper merging. - D.H. // if (next != null // && next.Property == this.Property) // Using new comparison. if (next != null && next.Property.Name == this.Property.Name && next.Property.Parent == this.Property.Parent && next.Property.CanSetValue == this.Property.CanSetValue) { this.NewValue = next.NewValue; Property.SetValue(NewValue); return(true); } return(false); }