PageRenderTime 11ms CodeModel.GetById 1ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/Main/src/DynamicDataDisplay/ExtendedPropertyChangedEventArgs.cs

#
C# | 29 lines | 26 code | 3 blank | 0 comment | 0 complexity | 5bcc9a9828205dcd89d63df4e45f55ac MD5 | raw file
 1using System;
 2using System.Collections.Generic;
 3using System.Linq;
 4using System.Text;
 5using System.Windows;
 6using System.ComponentModel;
 7using Microsoft.Research.DynamicDataDisplay;
 8
 9namespace Microsoft.Research.DynamicDataDisplay
10{
11	public sealed class ExtendedPropertyChangedEventArgs : EventArgs
12	{
13		public string PropertyName { get; set; }
14		public object OldValue { get; set; }
15		public object NewValue { get; set; }
16		public ChangeType ChangeType { get; set; }
17
18		public static ExtendedPropertyChangedEventArgs FromDependencyPropertyChanged(DependencyPropertyChangedEventArgs e)
19		{
20			return new ExtendedPropertyChangedEventArgs { PropertyName = e.Property.Name, NewValue = e.NewValue, OldValue = e.OldValue };
21		}
22
23		internal ExtendedPropertyChangedEventArgs WithChangeType(ChangeType changeType)
24		{
25			ChangeType = changeType;
26			return this;
27		}
28	}
29}