Skip to content

Instantly share code, notes, and snippets.

@azyobuzin
Created May 27, 2011 08:29
Show Gist options
  • Save azyobuzin/994857 to your computer and use it in GitHub Desktop.
Save azyobuzin/994857 to your computer and use it in GitHub Desktop.
public static void NotifyModelPropertyChanged(ViewModel vm, INotifyPropertyChanged model)
{
ViewModelHelper.BindNotifyChanged(model, vm, (sender, e) =>
{
var t = vm.GetType();
if (t.GetMember(
e.PropertyName,
BindingFlags.Public |
BindingFlags.Instance |
BindingFlags.GetProperty
)
!= null)
{
t.InvokeMember("RaisePropertyChanged",
BindingFlags.InvokeMethod | BindingFlags.Instance | BindingFlags.NonPublic,
null,
vm,
new object[] { e.PropertyName });
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment