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.
- Paul Gotzel asked 3 years ago
- last edited 3 years ago
- You must login to post comments
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.
- Nazariy Pelyushkevych answered 3 years ago
- last edited 3 years ago
- You must login to post comments
Please login first to submit.