I have a ViewModel class which has large number of properties(Say 50). Once the data is set on to all the properties I need to update the UI. I know that the common solution is to raise PropertyChanged on all the property setters.
I am wondering if there is any way I can notify my DataTemplate to update all its bindings through a single notification? One idea is to have a IsLoaded property which raises the propertychanged but how can I use that to update the entire DataTemplate. I am interested in a total XAML solution to this.
Finally I have got an answer from my colleague Josh Smith , it is very simple, we just need to raise a PropertyChanged event with null or String.Empty as property name. which will tell the WPF binding system to re-evaluate all the bindings of that object. I am getting two major advantage while using this.
Assumption : As in the question I assumed here that it is a very special condition in which all my Properties are getting updated at the same time
I have a blogpost discussing this here
Update: based on the comment from kek444
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With