简体   繁体   中英

AOP w/ PostSharp - Classic NotifyPropertyChanged PropertyChanged Event Handler Missing?

New to PostSharp 2.0 and trying out the class NotifyPropertyChanged AOP provided here: http://www.sharpcrafters.com/solutions/ui#undo-redo

When I attempt to hook into the PropertyChanged event handler the compiler tells me it is not defined. I have not directly implemented the INotifyPropertyChanged interface on the object in question, only applied the attribute.

I would assume the answer is to implement the interface but this defeats the simplicity a bit, am I missing something or is that also a requirement?

Is there any way to get PostSharp to modify the class pre-compile to introduce these members/interfaces?

I suppose, you are trying to subscribe to the event in the same assembly. PostSharp is rewriting your assembly after it has been compiled. So this will only work, if you reference the assembly that has been rewritten by the PostSharp binary rewriter.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM