WPF中使用较少的事件(event)记录
Window.ContentRendered
ContentRendered 事件在窗口的内容呈现完毕之后发生。如果该窗口不包含任何内容,则不会引发此事件。
而 Window.Loaded 事件:当元素布局,呈现和准备交互时发生。
具体使用如下代码,代码中将 Window_ContentRendered 绑定到 ContentRendered 事件上。
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="900" Width="1350"
ContentRendered ="Window_ContentRendered"
>