Here's the setup, we have a SeriesCollection with a preview and a chart linked to it.
When we click on the preview it open up the chart.
the
next step is to build the chart, once it is built we then want to zoom
with the mouse wheel which throws and exception,
BUT if instead of
directly zooming we close the chart, and then re-open it
via the preview the zoom will work as expected.
Here is the
exception thrown : {"Index was out of range. Must be non-negative and less than the size of the collection. \r\nParameter name: index"}
its
StackTrace :
at System.ThrowHelper.ThrowArgumentOutOfRangeException()
at System.Collections.Generic.List`1.get_Item(Int32 index)
at System.Collections.ObjectModel.Collection`1.get_Item(Int32 index)
at Syncfusion.UI.Xaml.Charts.ChartZoomPanBehavior.MouseWheelZoom(Point mousePoint, Double direction)
at Syncfusion.UI.Xaml.Charts.ChartZoomPanBehavior.OnMouseWheel(MouseWheelEventArgs e)
at Syncfusion.UI.Xaml.Charts.SfChart.OnMouseWheel(MouseWheelEventArgs e)
at CanmetENERGY.IBioref.UI.Views.Charts.SfChartCanMet.OnMouseWheel(MouseWheelEventArgs e) in c:\Code\IBIOREF\trunk\IBioref\UI\Views\Charts\SFChartCanMet.cs:line 20
at System.Windows.UIElement.OnMouseWheelThunk(Object sender, MouseWheelEventArgs e)
at System.Windows.Input.MouseWheelEventArgs.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.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Window.ShowHelper(Object booleanBox)
at System.Windows.Window.Show()
at System.Windows.Window.ShowDialog()
at CanmetENERGY.IBioref.UI.Views.DialogView.CanmetENERGY.Common.Presentation.IDialogView.ShowDialog(ViewModelBase viewModel, String title) in c:\Code\IBIOREF\trunk\IBioref\UI\Views\DialogView.xaml.cs:line 30
at CanmetENERGY.IBioref.Presentation.ViewModels.Charts.ChartsViewModel.ShowChartBuilder() in c:\Code\IBIOREF\trunk\IBioref\Presentation\ViewModels\Charts\ChartsViewModel.cs:line 158
at CanmetENERGY.IBioref.Presentation.ViewModels.Charts.ChartsViewModel.AddNewChart() in c:\Code\IBIOREF\trunk\IBioref\Presentation\ViewModels\Charts\ChartsViewModel.cs:line 138
Any idea of what could cause this ?