Files
FeedCenter/Application/Options/UpdateOptionsPanel.xaml.cs
2023-04-12 13:44:15 -04:00

36 lines
1.1 KiB
C#

using System.Windows;
using ChrisKaczor.ApplicationUpdate;
namespace FeedCenter.Options;
public partial class UpdateOptionsPanel
{
public UpdateOptionsPanel(Window parentWindow) : base(parentWindow)
{
InitializeComponent();
}
public override string CategoryName => Properties.Resources.optionCategoryUpdate;
public override void LoadPanel()
{
base.LoadPanel();
CheckVersionOnStartupCheckBox.IsChecked = Properties.Settings.Default.CheckVersionAtStartup;
MarkLoaded();
}
private void HandleCheckVersionNowButtonClick(object sender, System.Windows.RoutedEventArgs e)
{
UpdateCheck.DisplayUpdateInformation(true);
}
private void CheckVersionOnStartupCheckBox_Click(object sender, System.Windows.RoutedEventArgs e)
{
if (!HasLoaded) return;
if (CheckVersionOnStartupCheckBox.IsChecked.HasValue && Properties.Settings.Default.CheckVersionAtStartup != CheckVersionOnStartupCheckBox.IsChecked.Value)
Properties.Settings.Default.CheckVersionAtStartup = CheckVersionOnStartupCheckBox.IsChecked.Value;
}
}