Exception occurs when setting CursorTool.Active in Silverlig

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
BlueMonkey
Newbie
Newbie
Posts: 34
Joined: Tue Nov 04, 2008 12:00 am

Exception occurs when setting CursorTool.Active in Silverlig

Post by BlueMonkey » Tue Jun 22, 2010 10:04 pm

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;

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Exception occurs when setting CursorTool.Active in Silverlig

Post by Sandra » Wed Jun 23, 2010 9:16 am

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,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

BlueMonkey
Newbie
Newbie
Posts: 34
Joined: Tue Nov 04, 2008 12:00 am

Re: Exception occurs when setting CursorTool.Active in Silverlig

Post by BlueMonkey » Wed Jun 23, 2010 4:39 pm

That solved my problem. Thanks!

Post Reply