Files
speckle.xunit.runner.wpf/xunit.runner.wpf/MainWindow.xaml.cs
T
Dustin Campbell 135eccb795 Save and restore the position of the Main window
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.
2015-12-03 08:37:59 -08:00

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);
}
}
}