开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜