SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, iOS Chart, Android Chart and JavaScript Chart Components
I saw in tips and tricks for performance the use of
scichartsurface.suspendupdate
before something is added to the dataseries. But usually I don’t have access in ViewModel to surface. How can I suspendupdate in the ViewModel when updating the series?
Is dataseries.SuspendUpdate used for this?
Hi Uwe,
This has been asked a few times before. What DataSeries.SuspendUpdates does is it locks the parent surface SyncRoot object ensuring that Render Operations cannot be processed while the DataSeries is being updated e.g.
var ds0 = new XyDataSeries<double,double>();
var ds1 = new XyDataSeries<double,double>();
// can suspend one dataseries, which locks the parent surface
using (ds0.SuspendUpdates())
{
// Can append many dataseries
ds0.Append(..., ...);
ds1.Append(..., ...);
}
// parent surface redraws
DataSeries.SuspendUpdates() doesn’t behave exactly the same as SciChartSurface.SuspendUpdates(), but it does synchonize the DataSeries and SciChartSurface preventing re-draw inside the suspend updates block.
Let me know if this works in your situation.
Best regards,
Andrew
Please login first to submit.