Apply Logic in the viewmodel

This commit is contained in:
Kevin Zhang 2022-08-01 11:36:35 -05:00 committed by GitHub
parent c557031ef1
commit ec4f3a781a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 13 deletions

View file

@ -598,10 +598,8 @@
<TextBlock Style="{DynamicResource SettingTitleLabel}" Text="{DynamicResource startFlowLauncherOnSystemStartup}" />
</StackPanel>
<CheckBox
Checked="OnAutoStartupChecked"
IsChecked="{Binding Settings.StartFlowLauncherOnSystemStartup}"
Style="{DynamicResource SideControlCheckBox}"
Unchecked="OnAutoStartupUncheck" />
Style="{DynamicResource SideControlCheckBox}"/>
<TextBlock Style="{StaticResource Glyph}">
&#xe8fc;
</TextBlock>

View file

@ -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

View file

@ -60,7 +60,13 @@ namespace Flow.Launcher.ViewModel
Settings.AutoUpdates = value;
if (value)
{
UpdateApp();
SetStartup();
} else
{
RemoveStartup();
}
}
}