-
添加引用System.Windows.Interactivity
下载地址:https://www.microsoft.com/en-us/download/details.aspx?id=10801 -
在xml 文件中添加:
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
-
绑定事件
<i:Interaction.Triggers>
<i:EventTrigger EventName="ContentRendered">
<i:InvokeCommandAction