Pre loader

Best practices for SciChart ViewModels in MVVM

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,

I’m trying out sciCharts for our MVVM application. From what I can see, if I want to use bindings to attach our view models to a sciChartSurface’s SeriesSource dependency property, they’ll have to derive from ChartSeriesViewModel? As we’ve got quite a few view models, is there a way to avoid that?

Thanks,
Shawn

  • You must to post comments
0
0

Hi Shawn,

Actually they just need to implement IChartSeriesViewModel, so you can have your own base class, but we expect certain behaviour to get DataSeries or RenderableSeries pairs.

Alternatively, you can just expose N DataSeries in the ViewModel and bind directly to RenderableSeries declared in XAML, however this method doesn’t allow for adding/removing series dynamically.

Finally, a really good idea we’ve seen (submitting from a customer) was to create an attached behaviour to dynamically grow or shrink RenderableSeries based on a collection of DataSeries it bound to. Sorry, I can’t share an example at this time, but thought you might find it a useful idea.

Best regards,
Andrew

  • 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