Page 1 of 1

Exception occurs when setting CursorTool.Active in Silverlig

Posted: Tue Jun 22, 2010 10:04 pm
by 10050727
I am encountering an access violation when I try to set the Active member of the CursorTool object to true.

Is this a known problem or am I doing something wrong? I am porting a working WPF charting application over to Silverlight.

I am using Visual Studio 2010 with the latest .NET charting tools.

Thanks,
Kent

private CursorTool ChartTool1 = new CursorTool();
ChartTool1.Active = false;

Re: Exception occurs when setting CursorTool.Active in Silverlig

Posted: Wed Jun 23, 2010 9:16 am
by 10050769
Hello Kent,

I think that your problem is here:

Code: Select all

private CursorTool ChartTool1 = new CursorTool();
You need to assign cursorTool a Chart, for works with it. I have made a simple example that works correctly here with last version of TeeChartSilverlight and you can use for solve your problem.

Code: Select all

        Steema.TeeChart.Silverlight.Styles.Line line1;
        Steema.TeeChart.Silverlight.Tools.CursorTool cursor1;
        private void InitializeChart()
        {
            cursor1 = new Steema.TeeChart.Silverlight.Tools.CursorTool(tChart1.Chart);
            line1 = new Steema.TeeChart.Silverlight.Styles.Line(tChart1.Chart);
            line1.FillSampleValues();
            cursor1.Active = false;
        }
Please, could you check if previous code works as you want?

I hope will helps.

Thanks,

Re: Exception occurs when setting CursorTool.Active in Silverlig

Posted: Wed Jun 23, 2010 4:39 pm
by 10050727
That solved my problem. Thanks!