The full sequence of events fired for a Window object are as follows.
On application startup, if the Window is the application’s main window. (Application events are also shown in the correct sequence).
- Application.Startup
- Window.Initialized
- Window.IsVisibleChanged
- Window.SizeChanged
- Window.LayoutUpdated
- Window.SourceInitialized
- Application.Activated
- Window.Activated
- Window.PreviewGotKeyboardFocus
- Window.IsKeyboardFocusWithinChanged
- Window.IsKeyboardFocusedChanged
- Window.GotKeyboardFocus
- Window.LayoutUpdated
- Window.Loaded
- Window.ContentRendered
On normal application shutdown, the event sequence is:
- Window.Closing
- Window.IsVisibleChanged
- Window.Deactivated
- Application.Deactivated
- Window.IsKeyboardFocusWithinChanged
- Window.IsKeyboardFocusedChanged
- Window.LostKeyboardFocus
- Window.Closed
- Application.Exit
Read more: 2,000 Things You Should Know About WPF
QR: ![Inline image 1](http://chart.googleapis.com/chart?chs=80x80&cht=qr&choe=UTF-8&chl=http://wpf.2000things.com/2012/07/30/613-window-event-sequence/)
0 comments:
Post a Comment