Pre loader

How to bind CustomRenderableSeries to CustomViewModel when using SeriesBinding markup extension

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

In following example, how do I then bind the dependency properties of the SplineLineRenderableSeries to the SplineRenderableSeriesViewModel? For example, I’d like to have a change of the IsSplineEnabled property of the view model trigger a rerender of the series.

Worked Example – CustomRenderableSeries in MVVM

Version
6
  • You must to post comments
0
0

Hello Paul,

In order to have you need to change style “splineSeriesStyle” and its “IsSplineEnabled” property setter from this:

<Setter Property="IsSplineEnabled" Value="True"/>

to this one:

<Setter Property="IsSplineEnabled" Value="{Binding IsSplineEnabled, Mode=TwoWay}"/>

Also while investigating your question I’ve found out that custom series that is used in the documentation you’ve mentioned have missed handler on its dependency properties.

So in order to get your custom series redraw automatically on changing properties on its ViewModel you have to update your SplineLineRenderableSeries dependency properties so their PropertyMetada inclube OnPropertyChangedCallback that should invoke surface invalidation

 private static void PropertyChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            OnInvalidateParentSurface(d, e);
        }

We’ll update mentioned documentation post with the latest changes.
Also I’ve created a small sample application for you, please find it attached.

  • 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