I am trying to measure how long it takes for different Silverlight chart libraries (e.g. Silverlight Control Toolkit, Visifire, Telerik) to load onto the screen.
My problem is that I can measure the time until the control is loaded and the drawing starts to happen on the screen, however, the rendering takes longer due to animation effects (like damping of dots).
Is there a chance that I will be able to set up some kind of automatic way to detect when the rendering has finished? My problem is that I found the Loaded event handler in the Silverlight Framework element, which only the notification of the start of rendering is clicked on.
The sample code that I am currently using for the 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! }
source share