Is it possible to implement Property Changed as Attribute?

前端 未结 2 1313
渐次进展
渐次进展 2021-01-20 15:19

I have found an implementation of Propperty Changed Event, where i can Call Property changed without the Name of the Property in the web. And then i have build a Extension M

2条回答
  •  情深已故
    2021-01-20 15:43

    You will need some kind of AOP system to do this.

    Either something where you wrap or inherit from your class, and dynamically generate the necessary plumbing in the wrapper/descendant to handle this, or some system like Postsharp that rewrites your code after compilation.

    There is nothing built into .NET to handle this.

提交回复
热议问题