Implementing INotifyPropertyChanged - does a better way exist?

前端 未结 30 2688
感情败类
感情败类 2020-11-21 05:23

Microsoft should have implemented something snappy for INotifyPropertyChanged, like in the automatic properties, just specify {get; set; notify;} I

30条回答
  •  情深已故
    2020-11-21 05:30

    Other things you may want to consider when implementing these sorts of properties is the fact that the INotifyPropertyChang *ed *ing both use event argument classes.

    If you have a large number of properties that are being set then the number of event argument class instances can be huge, you should consider caching them as they are one of the areas that a string explosion can occur.

    Take a look at this implementation and explanation of why it was conceived.

    Josh Smiths Blog

提交回复
热议问题