Reputation: 1
I'm trying to wrap my head around how to handle this scenario with WPF by leveraging its binding capabilities. I have a model that I don't control, it's an external system that, given some inputs (lots, actually) produces an output (lots here too). The output of this system is what I need to display on the UI, but I'm wondering how I should leverage WFP bindings to carry out incremental updates, since I don't control the model and can't know what has changed in the output since last call to the external system (actually, very little might have changed, so it really doesn't make sense to rebind the while model).
I would like to be able to perform incremental updates to the UI instead of rebinding the entire data, which kills the smoothness of the UI and represents a usability problem. Is there a common way of handling this or should I just reflect over the output and produce change notifications artificially?
Upvotes: 0
Views: 106
Reputation: 12119
Store the otuputs in ObservableCollection(s) and bind your UI elements to that. Write code to update/add your model outputs to these ObservableCollection(s) in the background and your elements bound to these ObservableCollection(s) will update automatically.
There is a good article by Ken Getz on how to achive this over on MSDN
Upvotes: 1