Window.loaded fires before the window is fully loaded Window.loaded fires before the window is fully loaded wpf wpf

Window.loaded fires before the window is fully loaded


Looking into Object Lifetime Events article in MSDN you can find:

The Loaded event is raised before the final rendering, but after the layout system has calculated all necessary values for rendering. Loaded entails that the logical tree that an element is contained within is complete, and connects to a presentation source that provides the HWND and the rendering surface.

You should try some alternative events which are not exactly suited for your need. You should try in following order:

Take note that these events may fire multiple times during lifetime of your window, so write your application with that in mind.

WPF is data driven UI architecture and it's not very pleasant to work with in a way we are used to in WinForms. As someone smarter than me once said, WPF makes hard things trivial and trivial things hard.