這是C#WPF應用程序。我有一個Button
關閉應用程序。是否有與窗口右上角的(x)按鈕相關的默認關閉事件。什麼是XAML中的默認關閉事件?
基本上,我希望有一個像下面這樣的純XAML的解決方案:
<Button CloseWhenClick></Button>
的這個代替:
<Button Click="CloseWindow_Click"></Button>
private void Close(object sender, RoutedEventArgs e)
{
Window.Close();
}
[編輯 - 答案】
我一直在尋找用於:
<Button Command="Close"></Button>
任何具體原因'純XAML'解決方案? –