mirror of
https://github.com/9ParsonsB/Pulsar.git
synced 2025-04-05 17:39:39 -04:00
Save main window position/size.
This commit is contained in:
parent
c6daa10d0c
commit
e68d8d0690
@ -1,8 +1,6 @@
|
|||||||
using Avalonia;
|
using Avalonia;
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
using Avalonia.Markup.Xaml;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Data;
|
|
||||||
|
|
||||||
|
|
||||||
namespace Observatory.UI.Views
|
namespace Observatory.UI.Views
|
||||||
@ -15,7 +13,17 @@ namespace Observatory.UI.Views
|
|||||||
#if DEBUG
|
#if DEBUG
|
||||||
this.AttachDevTools();
|
this.AttachDevTools();
|
||||||
#endif
|
#endif
|
||||||
|
Height = Properties.Core.Default.MainWindowSize.Height;
|
||||||
|
Width = Properties.Core.Default.MainWindowSize.Width;
|
||||||
|
Position = new PixelPoint(Properties.Core.Default.MainWindowPosition.X, Properties.Core.Default.MainWindowPosition.Y);
|
||||||
|
Closing += (object sender, System.ComponentModel.CancelEventArgs e) =>
|
||||||
|
{
|
||||||
|
var size = new System.Drawing.Size((int)System.Math.Round(Width), (int)System.Math.Round(Height));
|
||||||
|
var position = new System.Drawing.Point(Position.X, Position.Y);
|
||||||
|
Properties.Core.Default.MainWindowSize = size;
|
||||||
|
Properties.Core.Default.MainWindowPosition = position;
|
||||||
|
Properties.Core.Default.Save();
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user