private static void TestProperty (INotifyPropertyChanged model, SharedProperty propertyName, object oldValue, object newValue) { Console.WriteLine(propertyName + @"Test"); object value = GetPropertyValue(model, propertyName.ToString()); Assert.AreEqual(oldValue, value); model.PropertyChanged += delegate(object sender, PropertyChangedEventArgs e) { Assert.AreEqual(propertyName.ToString(), e.PropertyName); Assert.AreEqual(newValue, GetPropertyValue(model, propertyName.ToString())); Console.WriteLine(propertyName + @" changed."); }; SetPropertyValue(model, propertyName.ToString(), newValue); }
protected virtual void RaisePropertyChangedEvent(SharedProperty property) { var eventHandler = PropertyChanged; if (eventHandler != null) { eventHandler(this, new PropertyChangedEventArgs(property.ToString())); } }