Hi,
I'm writing tests for the usual reason. I have a XamChart where I've added a drag feature for the user. The user can select a data point and move it up and down. The backing custom class is updated which cascades the update to a XamDataGrid. Everything works fine, but I'm running into problems during testing. Specifically, this line throws an exception:
var hitArgs = xamChart.HitTest(e);
Here is the exception:
System.NullReferenceException was unhandled by user code Message=Object reference not set to an instance of an object. Source=InfragisticsWPF3.Chart.v10.2 StackTrace: at Infragistics.Windows.Chart.XamChart.HitTest(MouseEventArgs e) at Intel.Wolf.UI.WPFMVApp.Helpers.XamChartHelper.MouseLeftButtonDownHandler(Object sender, MouseButtonEventArgs e) in C:\<...>\Helpers\XamChartHelper.cs:line 95 InnerException:
If I run the code in the Immediate Window I get this:
? xamChart == null
false
? e == null
xamChart.HitTest(e)
'xamChart.HitTest(e)' threw an exception of type 'System.NullReferenceException'
base {System.SystemException}: {"Object reference not set to an instance of an object."}
What 'Object'? Neither xamChart or e are null.
Complete method:
private static void MouseLeftButtonDownHandler(object sender, MouseButtonEventArgs e) { var xamChart = sender as XamChart; if (xamChart == null || e == null) return; var hitArgs = xamChart.HitTest(e); selectedDataPoint = hitArgs.SelectedObject as DataPoint; if (selectedDataPoint != null) { xamChart.Cursor = Cursors.SizeNS; started = true; } e.Handled = true; }
Here is my test:
[TestMethod] public void MouseLeftButtonDownHandlerTest() { var chart = new XamChart(); chart.Width = 300; // ??? Create a size to be selected ??? chart.Height = 300; XamChartHelper.SetChartDragging(chart, true); var e = new MouseButtonEventArgs(Mouse.PrimaryDevice, 0, MouseButton.Left); e.RoutedEvent = XamChart.MouseLeftButtonDownEvent; //chart.RaiseEvent(e); XamChartHelper_Accessor.MouseLeftButtonDownHandler(chart, e); // ToDo: Need more logic testing beyond "handled" Assert.IsTrue(e.Handled); }
VS 2010 Ultimate, Win7 x64, InfragisticsWPF3.Chart.v10.2
Can anyone point me in a direction?
We fixed one issue related to the chart hit test. Can you try applying the latest service release and tell us if your issue still exists?
I updated all of my dlls to the latest service release (downloaded today). No change in behavior. I'm still getting the same exception at the same place in my test execution.
dll version: 10.2.20102.2174
Ok, thanks. I’ve been trying reproducing this issue, but still no luck.
Is it possible to prepare for us a small sample that this issue is reproducing?
Have you had a chance to put together a small sample that generates the exception?
And here is the required data dll.
Building up this project I realized the error doesn't exist in WPF4.v10.3. I don't have approval to upgrade to WPF4 release at the moment. I'll work on it.
Let me know if you have any problems running my sample.
Hi Ivan, I have contacted with our Development team and we will try to get this issue fixed in to the next service release. I will get back to you as soon the service release is ready. Sincerely,DimiDeveloper Support Engineer, MCPD Infragistics, Inc.www.infragistics.com/support
Dimi,
Is there an ETA on this?
Thx,
Ivan
Hi Ivan,
We have working with our QE team and was able to confirm that this is development issue. In order to be notified when the fix is available I have created a case for you CAS-59771-K2MBR8. I will get back to you when I the service release is ready.
Thank you for your sample and explanations.
Sincerely,DimiDeveloper Support EngineerInfragistics, Inc.
Hello Ivan,
we have identified this as an issue. We have logged this into our tracking system under number 65830. Your support case will linked with the issue and you will receive notification when it is resolved.
Sincerely,
Horen Kirazyan