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

后端 未结 4 1640
难免孤独
难免孤独 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:32

    If you're using data binding, then you need to use the ContentRendered event.

    For the code below, the Header is NULL when the Loaded event is raised. However, Header gets its value when the ContentRendered event is raised.

    
    

提交回复
热议问题