Pre loader

Nullreference exception with VerticalSliceModifier Vertical lines

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



I have the following code for a vertical slice modifier

    <s:VerticalSliceModifier Name="sliceModifier"
                            <s:VerticalLineAnnotation Style="{StaticResource sliceStyle}"
                                                      X1="{Binding ParentViewModel.SliceModifierPosition, Mode=TwoWay}" />


This results in a nullreference exception. When I remove the VerticalLines, there is no nullreference exception, also no vertical lines.
As far as I can see ParentViewModel.SliceModifierPosition, does not have a value at the time.

I tried setting the visibility of the slicemodifier to collapsed, but it did not help the exception. Is there any to remove the slicemodifier for the time when X1 is not valid (using MVVM and not binding the slicemodifier itself)?

nullreference exception location
: Abt.Controls.SciChart.ChartModifiers.VerticalSliceModifier.OnAttached()
: Abt.Controls.SciChart.ChartModifiers.ModifierGroup.TB(IChartModifier C)
: Abt.Controls.SciChart.Common.Extensions.EnumerableExtensions. <a href="IEnumerable1 , Action1″>
: Abt.Controls.SciChart.ChartModifiers.ModifierGroup.TB(IEnumerable`1 C)
  • You must to post comments


Maybe, though my problem arises right on start of the application, so I do not have a chance to move the annotation at all.
Is it possible, that the scichartsurface is initialized, yet the AnnotationCollection containing the lineannotation is null, and gets a value only when there is a valid line annotation in it?

Best regards,

  • You must to post comments

Hi Kristof,

I haven’t seen all your code, so this is an assumption. Is it related to this issue?

Drag VerticalLineAnnotation caused NullReferenceException

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.