Reputation: 7288
I have an object that performs multiple calculations whenever any of is input values change.
There are a number of fields bound to the object in xaml. I am currently firing the propertychanged manually for each field however there are a number of properties affected by each update so this is getting tedious and messy.
Is there a way to update everything whenever PropertyChanged is fired regardless of the actual property?
Upvotes: 1
Views: 380
Reputation: 86718
If you call PropertyChanged(this, new PropertyChangedEventArgs(null))
once you're done with your calculations, all bindings bound to the obect will be updated at once. By specifying null
(empty string would also work), you're telling the binding engine "everything changed" so it will refresh all of its bindings against that object.
Upvotes: 2