Exemple #1
0
        public void CaptureNewValue(DependencyObject target, DependencyProperty property, object newValue)
        {
            var holder = new CaptureKeyHolder {
                Target = target, Property = property
            };

            if (captureHolders.ContainsKey(holder))
            {
                object oldValue = captureHolders[holder];

                var action = new DPUndoAction(target, property, oldValue, newValue);
                AddAction(action);
            }
        }
Exemple #2
0
            public override bool Equals(object obj)
            {
                if (obj == null)
                {
                    return(false);
                }

                CaptureKeyHolder other = obj as CaptureKeyHolder;

                if (other == null)
                {
                    return(false);
                }

                return(Target == other.Target && Property == other.Property);
            }
		public void CaptureNewValue(DependencyObject target, DependencyProperty property, object newValue)
		{
			var holder = new CaptureKeyHolder { Target = target, Property = property };
			if (captureHolders.ContainsKey(holder))
			{
				object oldValue = captureHolders[holder];
				captureHolders.Remove(holder);

				if (!Object.Equals(oldValue, newValue))
				{
					var action = new DependencyPropertyChangedUndoAction(target, property, oldValue, newValue);
					AddAction(action);
				}
			}
		}