Hi!
I have the following code for a vertical slice modifier
<s:VerticalSliceModifier Name="sliceModifier"
ReceiveHandledEvents="True"
>
<s:VerticalSliceModifier.VerticalLines>
<s:VerticalLineAnnotation Style="{StaticResource sliceStyle}"
X1="{Binding ParentViewModel.SliceModifierPosition, Mode=TwoWay}" />
</s:VerticalSliceModifier.VerticalLines>
</s:VerticalSliceModifier>
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.TB()
: Abt.Controls.SciChart.ChartModifiers.VerticalSliceModifier.OnAttached()
: Abt.Controls.SciChart.ChartModifiers.ModifierGroup.TB(IChartModifier C)
: Abt.Controls.SciChart.Common.Extensions.EnumerableExtensions. <a href="IEnumerable1 , Action
1″>
: Abt.Controls.SciChart.ChartModifiers.ModifierGroup.TB(IEnumerable`1 C)
- Kristóf Czimer asked 9 years ago
- last edited 9 years ago
- You must login to post comments
Hi Kristof,
I haven’t seen all your code, so this is an assumption. Is it related to this issue?
- slake answered 9 years ago
- last edited 9 years ago
- You must login to post comments
Hi!
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,
Kristóf
- Kristóf Czimer answered 9 years ago
- last edited 9 years ago
- You must login to post comments
Please login first to submit.