Cruft code. IoC to the rescue

后端 未结 4 1457
我在风中等你
我在风中等你 2021-01-30 23:08

In question about usefulness of IoC Container, the winning submitter mentioned that with an IoC container you can take this:

public class UglyCustomer : INotifyP         


        
4条回答
  •  别那么骄傲
    2021-01-31 00:05

    If you are looking for a specific solution for auto-generating bindable objects you should look at PropertyChanged.Fody (previously NotifyPropertyWeaver). This rewrites classes implementing INotifyPropertyChanged to include the notification code. There is an example on the github page.

    In my opinion this is neater than using the proposed IOC container solution. However, it is a library specific to INotifyPropertyChanged binding so is not applicable as a general solution, as was being discussed in your linked question.

提交回复
热议问题