63 lines
1.6 KiB
C#
63 lines
1.6 KiB
C#
using System.Windows;
|
|
|
|
namespace Intromat.Themes
|
|
{
|
|
public partial class ColorfulDarkTheme
|
|
{
|
|
private void CloseWindow_Event(object sender, RoutedEventArgs e)
|
|
{
|
|
if (e.Source != null)
|
|
try
|
|
{
|
|
CloseWind(Window.GetWindow((FrameworkElement)e.Source)!);
|
|
}
|
|
catch
|
|
{
|
|
// ignored
|
|
}
|
|
}
|
|
|
|
private void AutoMinimize_Event(object sender, RoutedEventArgs e)
|
|
{
|
|
if (e.Source != null)
|
|
try
|
|
{
|
|
MaximizeRestore(Window.GetWindow((FrameworkElement)e.Source)!);
|
|
}
|
|
catch
|
|
{
|
|
// ignored
|
|
}
|
|
}
|
|
|
|
private void Minimize_Event(object sender, RoutedEventArgs e)
|
|
{
|
|
if (e.Source != null)
|
|
try
|
|
{
|
|
MinimizeWind(Window.GetWindow((FrameworkElement)e.Source)!);
|
|
}
|
|
catch
|
|
{
|
|
// ignored
|
|
}
|
|
}
|
|
|
|
public void CloseWind(Window window)
|
|
{
|
|
window.Close();
|
|
}
|
|
|
|
public void MaximizeRestore(Window window)
|
|
{
|
|
if (window.WindowState == WindowState.Maximized)
|
|
window.WindowState = WindowState.Normal;
|
|
else if (window.WindowState == WindowState.Normal) window.WindowState = WindowState.Maximized;
|
|
}
|
|
|
|
public void MinimizeWind(Window window)
|
|
{
|
|
window.WindowState = WindowState.Minimized;
|
|
}
|
|
}
|
|
} |