|
|
@ -42,6 +42,7 @@ using StabilityMatrix.Core.Helper.Cache; |
|
|
|
using StabilityMatrix.Core.Helper.Factory; |
|
|
|
using StabilityMatrix.Core.Helper.Factory; |
|
|
|
using StabilityMatrix.Core.Models.Api; |
|
|
|
using StabilityMatrix.Core.Models.Api; |
|
|
|
using StabilityMatrix.Core.Models.Packages; |
|
|
|
using StabilityMatrix.Core.Models.Packages; |
|
|
|
|
|
|
|
using StabilityMatrix.Core.Models.Settings; |
|
|
|
using StabilityMatrix.Core.Python; |
|
|
|
using StabilityMatrix.Core.Python; |
|
|
|
using StabilityMatrix.Core.Services; |
|
|
|
using StabilityMatrix.Core.Services; |
|
|
|
using StabilityMatrix.Core.Updater; |
|
|
|
using StabilityMatrix.Core.Updater; |
|
|
@ -88,6 +89,19 @@ public sealed class App : Application |
|
|
|
mainWindow.DataContext = mainViewModel; |
|
|
|
mainWindow.DataContext = mainViewModel; |
|
|
|
mainWindow.NotificationService = notificationService; |
|
|
|
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; |
|
|
|
VisualRoot = mainWindow; |
|
|
|
StorageProvider = mainWindow.StorageProvider; |
|
|
|
StorageProvider = mainWindow.StorageProvider; |
|
|
|
|
|
|
|
|
|
|
@ -376,6 +390,10 @@ public sealed class App : Application |
|
|
|
sharedFolders.RemoveLinksForAllPackages(); |
|
|
|
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"); |
|
|
|
Debug.WriteLine("Start OnExit: Disposing services"); |
|
|
|
// Dispose all services |
|
|
|
// Dispose all services |
|
|
|
foreach (var disposable in Services.GetServices<IDisposable>()) |
|
|
|
foreach (var disposable in Services.GetServices<IDisposable>()) |
|
|
|