For example, I create a Canvas that contains a big amount of Shapes like this:
var canvas = CreateCanvasThatContainsShapes();
Then I add all the canvas to main page:
layoutRoot.Content = canvas;
It takes not so much time for those two lines of code to run, but it take a while for all the shapes to show up on the screen, and the UI will be unresponsive for a while.
In WPF, I can test the visual tree rendering time by doing something like this:
//create logic tree and add it to main page
stopWatch.Start();
Dispatcher.BeginInvoke(new Action(()=>{
stopWatch.Stop();
//Show the ellipsed time
}),DispatcherPriority.Loaded);
This way, the Stopwatch starts after the logic tree is created and stops after the visual tree is rendered(loaded).
But in silverlight, there is no DispatcherPriority, then how can I do the similar thing?
Thanks