0
如何将CancelEventArgs
发送到窗口关闭的视图模型?我尝试了以下方式,但CloseWindow命令方法始终将空参数CancelEventArgs
作为参数。如何获得CancelEventArgs
以棱镜方式查看模型?Prism for WPF - 如何发送CancelEventArgs到viewmodel?
<!-- View-->
<interactivity:Interaction.Triggers>
<interactivity:EventTrigger EventName="Closing">
<interactivity:InvokeCommandAction Command="{Binding CloseWindowCommand}" />
</interactivity:EventTrigger>
</interactivity:Interaction.Triggers>
视图模型
CloseWindowCommand = DelegateCommand<CancelEventArgs>.FromAsyncHandler(CloseWindow);
public async Task CloseWindow(CancelEventArgs args)
{
//Do Stuff
}