This commit is contained in:
bao-qian 2016-05-09 22:56:05 +01:00
parent fb3ba16a92
commit f376e1ab01
3 changed files with 2 additions and 3 deletions

View File

@ -85,8 +85,7 @@ namespace Wox
// but if sessionending is not called, exit won't be called when log off / shutdown
if (!_disposed)
{
var vm = (MainViewModel)Current.MainWindow.DataContext;
vm.Save();
((MainViewModel)Current.MainWindow?.DataContext)?.Save();
_disposed = true;
}
}

View File

@ -53,6 +53,7 @@ namespace Wox
{
InitProgressbarAnimation();
WindowIntelopHelper.DisableControlBox(this);
ThemeManager.Instance.ChangeTheme(_settings.Theme);
var vm = (MainViewModel)DataContext;
vm.TextBoxSelected += (o, e) => QueryTextBox.SelectAll();

View File

@ -69,7 +69,6 @@ namespace Wox.ViewModel
InternationalizationManager.Instance.Settings = _settings;
InternationalizationManager.Instance.ChangeLanguage(_settings.Language);
ThemeManager.Instance.Settings = _settings;
ThemeManager.Instance.ChangeTheme(_settings.Theme);
_queryHistoryStorage = new JsonStrorage<QueryHistory>();
_userSelectedRecordStorage = new JsonStrorage<UserSelectedRecord>();