Thursday 15 May 2014

c# - How to catch property changing using Postsharp? -



c# - How to catch property changing using Postsharp? -

i have viewmodel tagged [notifypropertychanged]. properties of course of study bound on input controls, textboxes. need know, model's property changed because of input.

how can grab event?

if class decorated notifypropertychanged implements inotifypropertychanged directly, postsharp requires there method signature:

void onpropertychanged(string propertyname)

this method has raise propertychanged event explicitly. working illustration this:

[notifypropertychanged] public class osmodel : inotifypropertychanged { public int p1 { get; set; } public event propertychangedeventhandler propertychanged; protected virtual void onpropertychanged(string propertyname) { propertychanged(this, new propertychangedeventargs(propertyname)); } }

additional info found here.

c# mvvm postsharp

No comments:

Post a Comment