public ShutdownTimerPicker(PersistentSettings.Settings settings) { ShutdownTimerSeconds = settings.ShutdownTimerSeconds; Action = settings.ShutdownTimerAction; InitializeComponent(); Enabled.IsChecked = ShutdownTimerSeconds.HasValue; SecondsToShutdownText.Text = ShutdownTimerSeconds.HasValue ? ShutdownTimerSeconds.Value.ToString() : ""; SecondsToShutdownText.IsEnabled = ShutdownTimerSeconds.HasValue; switch (Action) { case ShutdownTimerAction.Quit: TimerQuit.IsChecked = true; break; case ShutdownTimerAction.LaunchAndQuit: TimerLaunch.IsChecked = true; break; default: break; } }
private void TimerLaunch_Checked(object sender, RoutedEventArgs e) { Action = ShutdownTimerAction.LaunchAndQuit; }
private void TimerQuit_Checked(object sender, RoutedEventArgs e) { Action = ShutdownTimerAction.Quit; }