public override object GetValue(object component) { MyCustomType obj = (MyCustomType)component; object value = null; obj._propertyValues.TryGetValue(Name, out value); return(value); }
public MainWindow() { InitializeComponent(); var ctd = new MyCustomType(); ctd.AddProperty("Name", typeof(string)); // Now takes a Type argument. ctd.AddProperty("Age", typeof(int)); DataContext = ctd; }
public override void SetValue(object component, object value) { var oldValue = GetValue(component); if (oldValue != value) { MyCustomType obj = (MyCustomType)component; obj._propertyValues[Name] = value; OnValueChanged(component, new PropertyChangedEventArgs(Name)); } }