SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, iOS Chart, Android Chart and JavaScript Chart Components

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.