Example #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);
 }
Example #2
0
        private void OnMinimizeButtonClicked(object sender, RoutedEventArgs eventArgs)
        {
            var window = Window.GetWindow(this);

            if (window == null)
            {
                return;
            }

            SystemCommands.MinimizeWindow(window);
        }
Example #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);
            }
        }
Example #4
0
 private void OnRestoreWindow(object target, ExecutedRoutedEventArgs e)
 {
     SystemCommands.RestoreWindow(this);
 }
Example #5
0
 private void OnMinimizeWindow(object target, ExecutedRoutedEventArgs e)
 {
     SystemCommands.MinimizeWindow(this);
 }
Example #6
0
 private void WindowMinimize_Execute(object sender, ExecutedRoutedEventArgs e)
 {
     WinSystemCommands.MinimizeWindow(this);
 }
Example #7
0
 private void WindowRestore_Execute(object sender, ExecutedRoutedEventArgs e)
 {
     WinSystemCommands.RestoreWindow(this);
 }