mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 19:57:07 +02:00
Remove unused code and add required code for MVVM
This commit is contained in:
@@ -10,6 +10,8 @@ using Wox.CommandArgs;
|
||||
using Wox.Core.Plugin;
|
||||
using Wox.Helper;
|
||||
using Wox.Infrastructure;
|
||||
using Wox.Plugin;
|
||||
using Wox.ViewModel;
|
||||
using Stopwatch = Wox.Infrastructure.Stopwatch;
|
||||
|
||||
|
||||
@@ -20,6 +22,8 @@ namespace Wox
|
||||
private const string Unique = "Wox_Unique_Application_Mutex";
|
||||
public static MainWindow Window { get; private set; }
|
||||
|
||||
public static IPublicAPI API { get; private set; }
|
||||
|
||||
[STAThread]
|
||||
public static void Main()
|
||||
{
|
||||
@@ -40,8 +44,14 @@ namespace Wox
|
||||
WoxDirectroy.Executable = Directory.GetParent(Assembly.GetExecutingAssembly().Location).ToString();
|
||||
RegisterUnhandledException();
|
||||
ThreadPool.QueueUserWorkItem(o => { ImageLoader.ImageLoader.PreloadImages(); });
|
||||
|
||||
|
||||
MainViewModel mainVM = new MainViewModel();
|
||||
API = new PublicAPIInstance(mainVM);
|
||||
Window = new MainWindow();
|
||||
PluginManager.Init(Window);
|
||||
Window.DataContext = mainVM;
|
||||
|
||||
PluginManager.Init(API);
|
||||
CommandArgsFactory.Execute(e.Args.ToList());
|
||||
});
|
||||
|
||||
@@ -59,7 +69,7 @@ namespace Wox
|
||||
{
|
||||
if (args.Count > 0 && args[0] == SingleInstance<App>.Restart)
|
||||
{
|
||||
Window.CloseApp();
|
||||
API.CloseApp();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user