arslan tariq

arslan tariq

  • NA
  • 39
  • 1.4k

Telerik Control Radial Guage throws exeption

Jul 3 2013 8:16 AM
any body knows about the multi threading of metro apps in C#. i was tried to call as 
await System.Threading.Task(()=> myFunction()); but it throws an exception the threded function is as follows.

private async void runGuage()
{
try
{
if (guageNeedle != null)
{
guageProcess.Indicators.Remove(guageNeedle);
}
guageNeedle = new ArrowGaugeIndicator(); //<-- Exception Throws 
guageNeedle.Brush = new SolidColorBrush(Colors.Green);
guageNeedle.Thickness = 5;
guageNeedle.Value = randVal.Next(0, 100);
guageProcess.Indicators.Add(guageNeedle);
await Task.Delay(1000);
}
catch (Exception ex)
{
showMessage(ex.Message, "Error In Guage");
}
}

Exeption is :

A first chance exception of type 'System.Exception' occurred in Telerik.UI.Xaml.DataVisualization.DLL

Additional information: The application called an interface that was marshalled for a different thread. (Exception from HRESULT: 0x8001010E (RPC_E_WRONG_THREAD))

If there is a handler for this exception, the program may be safely continued.

----->>>>> Remeber i am using the the Telerik Controls (Radial Guage) 

Solution will be appreciable because i am stoked past 3 days :) Thanx