Sic.Framework/MECF.Framework.Common/WpfStyleableWindow/StyleableWindow/WindowCloseCommand.cs

25 lines
393 B
C#
Raw Normal View History

2023-04-13 11:51:03 +08:00
using System;
using System.Windows;
using System.Windows.Input;
namespace WpfStyleableWindow.StyleableWindow
{
public class WindowCloseCommand : ICommand
{
public event EventHandler CanExecuteChanged;
public bool CanExecute(object parameter)
{
return true;
}
public void Execute(object parameter)
{
if (parameter is Window window)
{
window.Close();
}
}
}
}