I upgraded my WPF controls to version 2011.2.712.35 to fix a problem with adding the Camera Extension to a Chart for zooming. When I did this I started getting a very odd error in a call to add a LegendItemMarkerShape to the Legend. The chart xaml looks like this:
and the code where I pass the marker shape looks like this:
mChartControl.DefaultView.ChartArea.Legend.LegendItemMarkerShape = value;
I am using VS2010 and the weird thing here is if I let the code run without inspecting the object in the QuickWatch
Dialog then it will exception with the error "Object reference not set to an instance of an object.". If I
go ahead and inspect the mChartControl object and drill all of the way down to the Lengend object the Legend
object will show "+Legend{Telerik.Windows.Controls.Charting.ChartLegend Header: Items.Count:0}" that it does
exist and the code will run as it should without exception, but if I just do a hover over the string in the
IDE the Legend oject will show a value of NULL and will exception. Please let me know what is going on here
and what can be done to correct this. Thanks for your help out there.