I am trying to measure how long it takes for different Silverlight charting libraries (e.g. Silverlight Control Toolkit, Visifire, Telerik) to load on screen.
My problem is that I can only measure the time until the control is loaded and drawing starts to take place on the screen, however rendering takes more time because of animation effects (e.g. points fading in).
Is there any chance I can set up some automated way of detecting when the rendering has ended? My problem is that I only found the Loaded event handler on a Silverlight Framework element to hook on to which only notifies of when rendering starts.
An example code I am currently using for Silverlight Control Toolkit is as follows:
public void Init()
{
Chart chart = new Chart(); // Init chart object
DataPointSeries series;
(...)// Init series, add lots of points, set data binding
Chart.Series.Add(series); // Add series to chart
chart.Loaded += new RoutedEventHandler(Chart_Loaded);
LayoutRoot.Children.Add(chart);
StartTimer(); // Start timer and wait for control to load
}
public void Chart_Loaded(object sender, RoutedEventArgs e)
{
StopTimer(); // Problem: rendering just started at this point, hasn't finished yet!
}