Beispiel #1
0
 protected override void OnInitialized(EventArgs e)
 {
     CommandBindings.Add(new CommandBinding(SystemCommands.MinimizeWindowCommand,
                                            (sender, args) => SystemCommands.MinimizeWindow((Window)args.Parameter)));
     CommandBindings.Add(new CommandBinding(SystemCommands.RestoreWindowCommand,
                                            (sender, args) => SystemCommands.RestoreWindow((Window)args.Parameter)));
     CommandBindings.Add(new CommandBinding(SystemCommands.MaximizeWindowCommand,
                                            (sender, args) => SystemCommands.MaximizeWindow((Window)args.Parameter)));
     base.OnInitialized(e);
 }
Beispiel #2
0
        private void OnMinimizeButtonClicked(object sender, RoutedEventArgs eventArgs)
        {
            var window = Window.GetWindow(this);

            if (window == null)
            {
                return;
            }

            SystemCommands.MinimizeWindow(window);
        }
Beispiel #3
0
        private void OnMaximizeButtonClicked(object sender, RoutedEventArgs eventArgs)
        {
            var window = Window.GetWindow(this);

            if (window == null)
            {
                return;
            }

            if (window.WindowState == WindowState.Maximized)
            {
                SystemCommands.RestoreWindow(window);
            }
            else
            {
                SystemCommands.MaximizeWindow(window);
            }
        }
Beispiel #4
0
 private void OnRestoreWindow(object target, ExecutedRoutedEventArgs e)
 {
     SystemCommands.RestoreWindow(this);
 }
Beispiel #5
0
 private void OnMinimizeWindow(object target, ExecutedRoutedEventArgs e)
 {
     SystemCommands.MinimizeWindow(this);
 }
Beispiel #6
0
 private void WindowMinimize_Execute(object sender, ExecutedRoutedEventArgs e)
 {
     WinSystemCommands.MinimizeWindow(this);
 }
Beispiel #7
0
 private void WindowRestore_Execute(object sender, ExecutedRoutedEventArgs e)
 {
     WinSystemCommands.RestoreWindow(this);
 }