mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-09 04:37:30 +02:00
Refactoring visibility related events
1. remove unnecessary events from MainViewModel 2. remove usage of Obsolete api (show, hide etc) 3. fix space problem in #660 4. part of #486 5. fix up/down key bug introduced in 92b7ca6a1bafd254e39ee92812ff691906cd85c1 6. fix #678
This commit is contained in:
@@ -8,7 +8,6 @@ using Wox.Core.UserSettings;
|
||||
using Wox.Helper;
|
||||
using Wox.Infrastructure.Image;
|
||||
using Wox.Infrastructure.Logger;
|
||||
using Wox.Infrastructure.Storage;
|
||||
using Wox.ViewModel;
|
||||
using Stopwatch = Wox.Infrastructure.Stopwatch;
|
||||
|
||||
@@ -61,7 +60,10 @@ namespace Wox
|
||||
AutoStartup();
|
||||
AutoUpdates();
|
||||
|
||||
window.Show();
|
||||
if (!_settings.HideOnStartup)
|
||||
{
|
||||
mainVM.MainWindowVisibility = Visibility.Visible;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -116,7 +118,7 @@ namespace Wox
|
||||
[Conditional("RELEASE")]
|
||||
private static void RegisterAppDomainExceptions()
|
||||
{
|
||||
|
||||
|
||||
AppDomain.CurrentDomain.UnhandledException += ErrorReporting.UnhandledExceptionHandle;
|
||||
AppDomain.CurrentDomain.FirstChanceException += (s, e) =>
|
||||
{
|
||||
@@ -131,14 +133,14 @@ namespace Wox
|
||||
// but if sessionending is not called, exit won't be called when log off / shutdown
|
||||
if (!_disposed)
|
||||
{
|
||||
Current.Dispatcher.Invoke(() => ((MainViewModel) Current.MainWindow?.DataContext)?.Save());
|
||||
Current.Dispatcher.Invoke(() => ((MainViewModel)Current.MainWindow?.DataContext)?.Save());
|
||||
_disposed = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void OnSecondAppStarted()
|
||||
{
|
||||
API.ShowApp();
|
||||
Current.MainWindow.Visibility = Visibility.Visible;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user