using System.Windows; using System.Windows.Input; namespace MyTests { public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); MainFrame.Content = new Pages.LoginPage(); } #region Кнопки закрытия и скрытия приложения private void Border_MouseDown(object sender, MouseButtonEventArgs e) { if (e.LeftButton == MouseButtonState.Pressed) DragMove(); // Возможность перетаскивать } private void ButtonMininize_Click(object sender, RoutedEventArgs e) { Application.Current.MainWindow.WindowState = WindowState.Minimized; //Скрытие } private void WindowStateButton_Click(object sender, RoutedEventArgs e) { if (Application.Current.MainWindow.WindowState != WindowState.Maximized) Application.Current.MainWindow.WindowState = WindowState.Maximized; else Application.Current.MainWindow.WindowState = WindowState.Normal; } private void CloseButton_Click(object sender, RoutedEventArgs e) { Application.Current.Shutdown(); // Закрытие программы } #endregion } }