Pre loader

Single instance of a chart with a MouseEventGroup defined crashes on mouse click

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

1
0

Hi All,

I have the following code in XAML:

<s:ModifierGroup s:MouseManager.MouseEventGroup="appLinkedChartGroup">
    <s:RubberBandXyZoomModifier x:Name="rubberBandZoomModifier" IsEnabled="True" IsXAxisOnly="False" IsAnimated="True" ExecuteOn="MouseRightButton" ZoomExtentsY="False" ReceiveHandledEvents="True"/>
    <s:ZoomPanModifier x:Name="zoomPanModifier" ExecuteOn="MouseLeftButton" ZoomExtentsY="False" ReceiveHandledEvents="True" IsEnabled="True"/>
    <s:ZoomExtentsModifier x:Name="zoomExtentsModifier" ExecuteOn="MouseDoubleClick" ReceiveHandledEvents="True"/>
    <s:MouseWheelZoomModifier ActionType="Zoom" XyDirection="XYDirection" ReceiveHandledEvents="True"/>
</s:ModifierGroup>

In my Code behind constructor I set the MouseEventGroup() as follows:

this.sciChartSurface.ChartModifier.MouseEventGroup = "appLinkedChartGroup";

So all instances of the class will have the same group. The test code then generates numerous classes and the charts pretty much work as expected (the bits that don’t are another thread)

However!

In a test I noticed that if I only have a single instance of the class, I can add data to it etc. but as soon as I click on the chart area it dies a death of “Object reference not set to an instance of an object” for which I have no source code. The stack trace is as follows:

at Abt.Controls.SciChart.ChartModifiers.RubberBandXyZoomModifier.OnModifierMouseDown(ModifierMouseArgs e)
at Abt.Controls.SciChart.ChartModifiers.ModifierGroup.UB(IChartModifier C, ModifierEventArgsBase D)
at Abt.Controls.SciChart.ChartModifiers.ModifierGroup.TB(Action2 C, ModifierEventArgsBase D)
at Abt.Controls.SciChart.ChartModifiers.ModifierGroup.OnModifierMouseDown(ModifierMouseArgs e)
at Abt.Controls.SciChart.Utility.Mouse.MouseManager. (ModifierMouseArgs , IReceiveMouseEvents , Boolean )
at Abt.Controls.SciChart.Utility.Mouse.MouseManager. . . (IReceiveMouseEvents )
at Abt.Controls.SciChart.Common.Extensions.EnumerableExtensions. [ ](IEnumerable1 , Action1 )
at Abt.Controls.SciChart.Utility.Mouse.MouseManager. . (Object , MouseButtonEventArgs )
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
at System.Windows.UIElement.OnMouseDownThunk(Object sender, MouseButtonEventArgs e)

If I take out the s:MouseManager.MouseEventGroup=”appLinkedChartGroup” it works fine (but the multiple charts don’t synch anymore) or if I run the multiple chart portion of the app first then it’s fine. I’m sure I’ve seen something about there not being available ancestors somewhere but can’t find that particular pearl of wisdom again now.

Anyway – pointers anyone?

  • You must to post comments
0
0

Hi Stuart,

I’ve just tried this today and I didn’t get a crash. What I did was I removed the lower chart in our Sync Multi Chart mouse example. The top chart still has a MouseEventGroup set. I am using our latest v3.3.x release.

What version are you using? Are you able to send over a code sample that reproduces the issue to support.scichart.com?

Best regards,
Andrew

Images
  • Stuart McCullough
    According to my Abt.Controls.SciChart.Wpf reference in DevStudio I'm on version 3.3.0.5909. I should probably tell you that what we have done is wrap a single chart in a user control and are calling multiple instances of that user control from code behind in our main app to create our multiple charts. The single instance version is created directly from the XAML of the main application. I'd have to isolate everything and construct a project for you - unfortunately now is not a good time as we have bods on site providing "input" to the project. Their new ideas are taking precedence over actually getting something to work so this is yet another item that might have to wait a week or two to get sorted :-(
  • Andrew Burnett-Thompson
    Ok no worries, we can wait, Just wanted to feedback that the simple case does not reproduce the error, so we are going to need more help from you to debug it. When you give us this -- we'll of course investigate! You might find an issue on your side in the process.
  • 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