When applying PostSharp's [INotifyPropertyChanged]
attribute to a class, is there a way to force PostSharp to ignore some of the properties?
Asked
Active
Viewed 862 times
3

Mau
- 14,234
- 2
- 31
- 52
-
Thought there are some articles that talk about implementing a `NotifyPropertyChangedAttribute` in the context of PostSharp... – Tim May 09 '14 at 12:28
-
@elgonzo: PostSharp provides a NotifyPropertyChanged *attribute* that you can place on a class, and PostSharp will then automatically implement the INotifyPropertyChanged *interface* on that class for you (so you don't have to implement it yourself). – Chris May 09 '14 at 12:29
-
Okay, ooops, i did not know. Feel free to slap me... :) – May 09 '14 at 12:30
-
@Tim, I read them but saw no references to ways of skipping certain properties. – Mau May 09 '14 at 12:30
-
@Mau that was actually a response to elgonzo (whose post has now been deleted). Sorry for the confusion. – Tim May 09 '14 at 13:01
1 Answers
5
There is a documentation article about Customizing the NotifyPropertyChanged Aspect.
Based on that article, you need to mark the property with [IgnoreAutoChangeNotification]
attribute to prevent the notification from being raised for that property.

AlexD
- 5,011
- 2
- 23
- 34