|
|
|
@ -42,6 +42,7 @@ using StabilityMatrix.Core.Helper.Cache;
|
|
|
|
|
using StabilityMatrix.Core.Helper.Factory; |
|
|
|
|
using StabilityMatrix.Core.Models.Api; |
|
|
|
|
using StabilityMatrix.Core.Models.Packages; |
|
|
|
|
using StabilityMatrix.Core.Models.Settings; |
|
|
|
|
using StabilityMatrix.Core.Python; |
|
|
|
|
using StabilityMatrix.Core.Services; |
|
|
|
|
using StabilityMatrix.Core.Updater; |
|
|
|
@ -88,6 +89,19 @@ public sealed class App : Application
|
|
|
|
|
mainWindow.DataContext = mainViewModel; |
|
|
|
|
mainWindow.NotificationService = notificationService; |
|
|
|
|
|
|
|
|
|
var settingsManager = Services.GetRequiredService<ISettingsManager>(); |
|
|
|
|
var windowSettings = settingsManager.Settings.WindowSettings; |
|
|
|
|
if (windowSettings != null) |
|
|
|
|
{ |
|
|
|
|
mainWindow.Position = new PixelPoint(windowSettings.X, windowSettings.Y); |
|
|
|
|
mainWindow.Width = windowSettings.Width; |
|
|
|
|
mainWindow.Height = windowSettings.Height; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
mainWindow.WindowStartupLocation = WindowStartupLocation.CenterScreen; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
VisualRoot = mainWindow; |
|
|
|
|
StorageProvider = mainWindow.StorageProvider; |
|
|
|
|
|
|
|
|
@ -376,6 +390,10 @@ public sealed class App : Application
|
|
|
|
|
sharedFolders.RemoveLinksForAllPackages(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var mainWindow = Services.GetRequiredService<MainWindow>(); |
|
|
|
|
settingsManager.Transaction(s => s.WindowSettings = new WindowSettings(mainWindow.Width, |
|
|
|
|
mainWindow.Height, mainWindow.Position.X, mainWindow.Position.Y)); |
|
|
|
|
|
|
|
|
|
Debug.WriteLine("Start OnExit: Disposing services"); |
|
|
|
|
// Dispose all services |
|
|
|
|
foreach (var disposable in Services.GetServices<IDisposable>()) |
|
|
|
|