Skip to content

Commit ec4f3a7

Browse files
authored
Apply Logic in the viewmodel
1 parent c557031 commit ec4f3a7

File tree

3 files changed

+7
-13
lines changed

3 files changed

+7
-13
lines changed

Flow.Launcher/SettingWindow.xaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -598,10 +598,8 @@
598598
<TextBlock Style="{DynamicResource SettingTitleLabel}" Text="{DynamicResource startFlowLauncherOnSystemStartup}" />
599599
</StackPanel>
600600
<CheckBox
601-
Checked="OnAutoStartupChecked"
602601
IsChecked="{Binding Settings.StartFlowLauncherOnSystemStartup}"
603-
Style="{DynamicResource SideControlCheckBox}"
604-
Unchecked="OnAutoStartupUncheck" />
602+
Style="{DynamicResource SideControlCheckBox}"/>
605603
<TextBlock Style="{StaticResource Glyph}">
606604
&#xe8fc;
607605
</TextBlock>

Flow.Launcher/SettingWindow.xaml.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,6 @@ private void OnLoaded(object sender, RoutedEventArgs e)
5757
hwndTarget.RenderMode = RenderMode.SoftwareOnly;
5858
}
5959

60-
private void OnAutoStartupChecked(object sender, RoutedEventArgs e)
61-
{
62-
viewModel.SetStartup();
63-
}
64-
65-
private void OnAutoStartupUncheck(object sender, RoutedEventArgs e)
66-
{
67-
viewModel.RemoveStartup();
68-
}
69-
7060
private void OnSelectPythonDirectoryClick(object sender, RoutedEventArgs e)
7161
{
7262
var dlg = new FolderBrowserDialog

Flow.Launcher/ViewModel/SettingWindowViewModel.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,13 @@ public bool AutoUpdates
6060
Settings.AutoUpdates = value;
6161

6262
if (value)
63+
{
6364
UpdateApp();
65+
SetStartup();
66+
} else
67+
{
68+
RemoveStartup();
69+
}
6470
}
6571
}
6672

0 commit comments

Comments
 (0)