Begin/EndUpdate when using data binding?

A forum dedicated to WPF version of LightningChart Ultimate.

Moderator: Queue Moderators

Post Reply
jrvdboom
Posts: 61
Joined: Thu Apr 10, 2014 1:50 pm

Begin/EndUpdate when using data binding?

Post by jrvdboom » Wed Sep 03, 2014 6:53 am

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

User avatar
ArctionPasi
Posts: 1367
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland
Contact:

Re: Begin/EndUpdate when using data binding?

Post by ArctionPasi » Wed Sep 03, 2014 7:34 am

We have thought about how to achieve that functionality, but haven't come up with a working solution. :(
LightningChart Support Team, PT

jrvdboom
Posts: 61
Joined: Thu Apr 10, 2014 1:50 pm

Re: Begin/EndUpdate when using data binding?

Post by jrvdboom » Mon Apr 13, 2015 10:20 am

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

Post Reply