port from perforce
This commit is contained in:
63
intromat/Intromat/Themes/ColorfulDarkTheme.xaml.cs
Normal file
63
intromat/Intromat/Themes/ColorfulDarkTheme.xaml.cs
Normal file
@@ -0,0 +1,63 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user