135eccb795
It's pretty annoying that the XUnit runner always starts with the same width and height. This change adds code to save and restore the position. It uses the Win32 `GetWindowPlacement` and `SetWindowPlacement` APIs to ensure that the normal position is properly saved and restored regardless of whether the window is maximized or not.
33 lines
664 B
C#
33 lines
664 B
C#
using System;
|
|
using System.ComponentModel;
|
|
using System.Windows;
|
|
|
|
namespace xunit.runner.wpf
|
|
{
|
|
public partial class MainWindow : Window
|
|
{
|
|
public static Window Instance { get; private set; }
|
|
|
|
public MainWindow()
|
|
{
|
|
Instance = this;
|
|
|
|
InitializeComponent();
|
|
}
|
|
|
|
protected override void OnSourceInitialized(EventArgs e)
|
|
{
|
|
base.OnSourceInitialized(e);
|
|
|
|
Storage.RestoreWindowLayout(this);
|
|
}
|
|
|
|
protected override void OnClosing(CancelEventArgs e)
|
|
{
|
|
Storage.SaveWindowLayout(this);
|
|
|
|
base.OnClosing(e);
|
|
}
|
|
}
|
|
}
|