I have this code:
Window w = // something
w.Loaded += // some code to take a screenshot of the window
w.Show();
The Loaded event fires before the window is fully loaded and I get this image:
I could add a Thread.Sleep
or something after w.Show()
and before the screenshot but I need to run this piece of code for hundreds of windows.
My question is: Is there another event that fires when the window is fully loaded? or some way to achieve this without putting the thread to sleep.
Thanks