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


After

I have a viewmodel that has been tagged with [NotifyPropertyChanged] . Properties are bound to input controls, such as text boxes, I need to know, that the property of the model was changed due to the input.

How can I catch this incident?

If the client decorated with a notebook implements INotifyPropertyChanged, then PostSharp requires that the signature There is a method with:

  Zero OnPropertyChanged (string propertyName)  

This method has been specifically changed to the property. A work example might look like this:

  [NotifyPropertyChanged] Public class OsModel: INotifyPropertyChanged {public integer P1 {find; Set; } Private Event PropertyChangedEventHandler PropertyChanged; Protected Virtual Zero OnPropertyChanged (string propertyName) {PropertyChanged (New, PropertyChangedEventArgs (propertyName)); }}  

Additional information can be found.


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -