From ec4f3a781a7568eebeea30839bb9d0e4a9e4306e Mon Sep 17 00:00:00 2001 From: Kevin Zhang <45326534+taooceros@users.noreply.github.com> Date: Mon, 1 Aug 2022 11:36:35 -0500 Subject: [PATCH] Apply Logic in the viewmodel --- Flow.Launcher/SettingWindow.xaml | 4 +--- Flow.Launcher/SettingWindow.xaml.cs | 10 ---------- Flow.Launcher/ViewModel/SettingWindowViewModel.cs | 6 ++++++ 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/Flow.Launcher/SettingWindow.xaml b/Flow.Launcher/SettingWindow.xaml index 652977686..abc8d7205 100644 --- a/Flow.Launcher/SettingWindow.xaml +++ b/Flow.Launcher/SettingWindow.xaml @@ -598,10 +598,8 @@ + Style="{DynamicResource SideControlCheckBox}"/> diff --git a/Flow.Launcher/SettingWindow.xaml.cs b/Flow.Launcher/SettingWindow.xaml.cs index d5259d497..c7b4baf2e 100644 --- a/Flow.Launcher/SettingWindow.xaml.cs +++ b/Flow.Launcher/SettingWindow.xaml.cs @@ -57,16 +57,6 @@ namespace Flow.Launcher hwndTarget.RenderMode = RenderMode.SoftwareOnly; } - private void OnAutoStartupChecked(object sender, RoutedEventArgs e) - { - viewModel.SetStartup(); - } - - private void OnAutoStartupUncheck(object sender, RoutedEventArgs e) - { - viewModel.RemoveStartup(); - } - private void OnSelectPythonDirectoryClick(object sender, RoutedEventArgs e) { var dlg = new FolderBrowserDialog diff --git a/Flow.Launcher/ViewModel/SettingWindowViewModel.cs b/Flow.Launcher/ViewModel/SettingWindowViewModel.cs index 587349045..189a7bdc8 100644 --- a/Flow.Launcher/ViewModel/SettingWindowViewModel.cs +++ b/Flow.Launcher/ViewModel/SettingWindowViewModel.cs @@ -60,7 +60,13 @@ namespace Flow.Launcher.ViewModel Settings.AutoUpdates = value; if (value) + { UpdateApp(); + SetStartup(); + } else + { + RemoveStartup(); + } } }