PageRenderTime 20ms CodeModel.GetById 19ms app.highlight 0ms RepoModel.GetById 1ms app.codeStats 0ms

/Main/src/Xbap/DynamicDataDisplay.Xbap.Samples/Internals/ViewState.cs

#
C# | 37 lines | 31 code | 6 blank | 0 comment | 2 complexity | 884c5e4f9f7c08253fb74a5a06bba12f MD5 | raw file
Possible License(s): CC-BY-SA-3.0
 1using System;
 2using System.Collections.Generic;
 3using System.Linq;
 4using System.Text;
 5using System.Windows;
 6using System.Diagnostics;
 7using System.ComponentModel;
 8
 9namespace Microsoft.Research.DynamicDataDisplay.Samples.Internals
10{
11	public class ViewState : DependencyObject, INotifyPropertyChanged
12	{
13		private static readonly ViewState state = new ViewState();
14
15		public static ViewState State { get { return state; } }
16
17		private object value;
18		public object SelectedValue
19		{
20			get { return value; }
21			set
22			{
23				this.value = value;
24				if (PropertyChanged != null)
25				{
26					PropertyChanged(this, new PropertyChangedEventArgs("SelectedValue"));
27				}
28			}
29		}
30
31		#region INotifyPropertyChanged Members
32
33		public event PropertyChangedEventHandler PropertyChanged;
34
35		#endregion
36	}
37}