当用户通过单击关闭按钮(红色 X 按钮)取消我的对话框时,我想执行特定操作
而不是当表单由于其他一些操作而关闭时。我如何确定是否
private void Window_Closing(object sender, CancelEventArgs e)
事件由按钮引发?
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Height="60" Width="284" WindowStartupLocation="CenterScreen"
BorderBrush="#FFCCCCCC"
BorderThickness="2"
Background="#FFE0E0E0"
WindowStyle="SingleBorderWindow"
ShowInTaskbar="False" ResizeMode="NoResize" Closing="Window_Closing">