mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 18:57:19 +02:00
Move initia and save from MainViewModel to App
This commit is contained in:
@@ -5,6 +5,7 @@ using System.Windows;
|
||||
using Wox.Core;
|
||||
using Wox.Core.Plugin;
|
||||
using Wox.Helper;
|
||||
using Wox.Infrastructure;
|
||||
using Wox.Infrastructure.Image;
|
||||
using Wox.Infrastructure.Logger;
|
||||
using Wox.Infrastructure.UserSettings;
|
||||
@@ -51,7 +52,7 @@ namespace Wox
|
||||
API = new PublicAPIInstance(settingVM, mainVM);
|
||||
PluginManager.InitializePlugins(API);
|
||||
|
||||
ImageLoader.PreloadImages();
|
||||
ImageLoader.Initialize();
|
||||
|
||||
Current.MainWindow = window;
|
||||
Current.MainWindow.Title = Infrastructure.Constant.Wox;
|
||||
@@ -132,6 +133,10 @@ namespace Wox
|
||||
if (!_disposed)
|
||||
{
|
||||
Current.Dispatcher.Invoke(() => ((MainViewModel)Current.MainWindow?.DataContext)?.Save());
|
||||
|
||||
PluginManager.Save();
|
||||
ImageLoader.Save();
|
||||
|
||||
_disposed = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -596,9 +596,6 @@ namespace Wox.ViewModel
|
||||
_userSelectedRecordStorage.Save();
|
||||
_topMostRecordStorage.Save();
|
||||
|
||||
PluginManager.Save();
|
||||
ImageLoader.Save();
|
||||
|
||||
_saved = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user