Pre loader

Persisting the changed style of a selected series

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 my SciChart InteractionToolbar, I have a slider that changes the stroke thickness of the selected series.

<TextBlock Text="Line Thickness:"/>
<wpfTool:IntegerUpDown Foreground="White" 
x:Name="Thickness" 
Minimum="1" 
Maximum="10" 
Value="{Binding SelectedSpectrum.StrokeThickness, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" ValueChanged="Thickness_ValueChanged">
</wpfTool:IntegerUpDown>

This works correctly until a new series is selected. When a new series is selected, the previously selected series thickness returns to its default of “1”. Is there a way I can persist my StrokeThickness value even when the series is no longer selected?

    private void Thickness_ValueChanged(object sender, RoutedPropertyChangedEventArgs<object> e)
    {
        if ((sciChartSurface.RenderableSeries != null) && (e.NewValue != null))
        {
            var selectedSeries = sciChartSurface.RenderableSeries.Where(s => s.IsSelected == true).FirstOrDefault();
            if (selectedSeries != null)
            {
                selectedSeries.StrokeThickness = (int)e.NewValue;
            }
        }
    }
Version
5.3
  • You must to post comments
0
0

Hello Kyle,

Thank you for your inquiry. I am sorry for the late reply.
Please try this with the latest SciChart v5.4 build. Here is how to get our nightly builds:
https://support.scichart.com/index.php?/Knowledgebase/Article/View/17232/37/getting-nightly-builds-with-nuget

Please let me know if this helps.

  • 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