如何引发CancelEventArgs

时间:2017-04-18 08:22:03

标签: c# wpf

如何使用C#

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

0 个答案:

没有答案