Pre loader

MVVM SuspendUpdates

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

0
0

Hi Andrew

We would like to be able to set SuspendUpdates in an MVVM scenario as we are using ObservableCollection of IChartSeriesViewModel to drive chart datatemplates.

We are getting some flickering when updating multiple series on the chart due to y axis rescaling.

Is there a bindable property on the SciChartSurface we can use for this? Or do you have another approach?

Thanks in advance
Regards
Ian

  • You must to post comments
1
0

Hi Ian,

One surefire way of ensuring you don’t get flicker is to update your DataSeries on the UI thread. The renderer draws on the UI and so updates of the DataSeries on a background thread can cause flicker, e.g. if you Clear then Add data to a DataSeries and the render operation occurs between the two you will momentarily see the redraw.

Another way is yes, you can call SuspendUpdates via a DataSeries. See the DataSeries.SuspendUpdates() method, which works the same as on the ParentSurface. However, note this makes the assumption that there is a 1:1 relationship between DataSeries and SciChartSurfaces (you have not registered a DataSeries on two parent surfaces).

Finally a surefire way to do this is create an attached Behaviour which binds to a property in your view model, and sets SuspendUpdates() / calls Dispose() on the IUpdateSuspender when the property changes.

Hope this helps,
Andrew

  • Ian Carson
    Hi Andrew Didn't know about DataSeries.SuspendUpdates(). That works nicely and fixed the problem. I have noted your warning about a 1-to-1 relationship - luckily not a problem for our solution currently. Thanks for the info Regards Ian
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies