What's the difference between the Window.Loaded and Window.ContentRendered events

后端 未结 4 1645
难免孤独
难免孤独 2020-12-13 06:00

What\'s the difference between the Window.Loaded and Window.ContentRendered events in WPF? Is the ContentRendered event called first?

4条回答
  •  不知归路
    2020-12-13 06:12

    If you visit this link https://msdn.microsoft.com/library/ms748948%28v=vs.100%29.aspx#Window_Lifetime_Events and scroll down to Window Lifetime Events it will show you the event order.

    Open:

    1. SourceInitiated
    2. Activated
    3. Loaded
    4. ContentRendered

    Close:

    1. Closing
    2. Deactivated
    3. Closed

提交回复
热议问题