Hourglass.Windows.ThemeManagerWindow.ThemesComboBoxSelectionChanged C# (CSharp) Method

ThemesComboBoxSelectionChanged() private method

Invoked when the selection in the ThemesComboBox changes.
private ThemesComboBoxSelectionChanged ( object sender, System.Windows.Controls.SelectionChangedEventArgs e ) : void
sender object The .
e System.Windows.Controls.SelectionChangedEventArgs The event data.
return void
        private void ThemesComboBoxSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ComboBoxItem selectedItem = (ComboBoxItem)this.ThemesComboBox.SelectedItem;
            if (selectedItem != null)
            {
                Theme newSelectedTheme = (Theme)selectedItem.Tag;
                if (newSelectedTheme.Identifier != this.selectedTheme.Identifier)
                {
                    if (this.PromptToSaveIfRequired())
                    {
                        this.timerWindow.Options.Theme = newSelectedTheme;
                        this.BindTimerWindow();
                    }
                    else
                    {
                        // Revert the selection
                        this.BindSelectedTheme();
                    }
                }
            }
        }