Page 1 of 1

Begin/EndUpdate when using data binding?

Posted: Wed Sep 03, 2014 6:53 am
by jrvdboom
I'm using data binding to change multiple properties of a chart at the same time. Unfortunately, I see them changing one by one instead of all at once. In code I would have surrounded the changes with BeginUpdate and EndUpdate, but I can't because I'm using data binding. Any suggestions on how to solve this?

Thanks,
Joost

Re: Begin/EndUpdate when using data binding?

Posted: Wed Sep 03, 2014 7:34 am
by ArctionPasi
We have thought about how to achieve that functionality, but haven't come up with a working solution. :(

Re: Begin/EndUpdate when using data binding?

Posted: Mon Apr 13, 2015 10:20 am
by jrvdboom
I found a solution that fulfills most of my needs regarding begin/end update and data binding:

Code: Select all

chart.BeginUpdate();
<perform update(s) on view model(s)>
chart.Dispatcher.BeginInvoke(new Action(() => chart.EndUpdate()), DispatcherPriority.Render);
This works because the DataBind phase is executed with a higher priority than the Render phase.
Hope this helps other users!

Cheers,
Joost