Microsoft should have implemented something snappy for INotifyPropertyChanged
, like in the automatic properties, just specify {get; set; notify;}
I
I'm writing a library that deals with INotifyPropertyChanged, and the main idea is using a dynamic proxy to notify changes.
the repo is here: CaulyKan/NoMorePropertyChanged
with this library, you can write:
public dynamic Test1Binding { get; set; }
public TestDTO Test1
{
get { return (TestDTO)Test1Binding; }
set { SetBinding(nameof(Test1Binding), value); }
}
Then make all bindings and modifications go to Test1Binding, which will notify PropertyChange and CollectionChanged automatically no matter how complex TestDTO is.
it can also handle dependencies.
[DependsOn("Test1Binding.TestString")]
public string Test2
{
get { return Test1Binding.TestString; }
}
Please give me some suggestions.