startup window size sanity check
This commit is contained in:
parent
59c6efcd7f
commit
b7ac38ca99
@ -2,7 +2,7 @@
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:BreCalClient"
|
||||
StartupUri="MainWindow.xaml" Exit="Application_Exit">
|
||||
StartupUri="MainWindow.xaml" Exit="Application_Exit" Startup="Application_Startup" >
|
||||
<Application.Resources>
|
||||
|
||||
<ResourceDictionary>
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
using BreCalClient.misc.Model;
|
||||
using BreCalClient.Properties;
|
||||
using System.Windows;
|
||||
|
||||
namespace BreCalClient
|
||||
@ -14,5 +15,20 @@ namespace BreCalClient
|
||||
{
|
||||
BreCalClient.Properties.Settings.Default.Save();
|
||||
}
|
||||
|
||||
private void Application_Startup(object sender, StartupEventArgs e)
|
||||
{
|
||||
// Window size sanity check
|
||||
if(Settings.Default.Width == 0)
|
||||
{
|
||||
Settings.Default.Width = 800;
|
||||
Settings.Default.Save();
|
||||
}
|
||||
if(Settings.Default.Height == 0)
|
||||
{
|
||||
Settings.Default.Height = 450;
|
||||
Settings.Default.Save();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user