private async void ShowAgainComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { try { UpdateShowAgainUI(); await VSTipHistoryManager.GetInstance().SetCadenceAsync(DisplayCadence.FromName(ShowAgainComboBox.SelectedValue.ToString())); } catch { } }
private void UpdateShowAgainUI() { var newCadence = DisplayCadence.FromName(ShowAgainComboBox.SelectedValue.ToString()); if (newCadence.ShowEstimate) { ShowAgainTextBlock.Text = LastDisplayTime.Add(newCadence.Delay).ToLocalTime().ToString("d"); ShowAgainPanel.Visibility = Visibility.Visible; } else { ShowAgainPanel.Visibility = Visibility.Collapsed; } }
public DisplayCadence GetCadence() { var cadenceString = SettingsManager.GetValueOrDefault(TIP_CADENCE, string.Empty); return(string.IsNullOrEmpty(cadenceString) ? DisplayCadence.Startup : DisplayCadence.FromName(cadenceString)); }