如何使用C#
在单元测试中引发CancelEventArgsvoid OnCloseWindow(object sender, CancelEventArgs e)
{
var window = base.DataContext as IWindowManagerService;
if (window != null)
{
e.Cancel = !window.CloseWindow();
}
}