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

AddThemesToComboBox() private method

Adds the specified themes to the ThemesComboBox.
private AddThemesToComboBox ( string title, IList themes ) : void
title string The section title.
themes IList The themes to add to the .
return void
        private void AddThemesToComboBox(string title, IList<Theme> themes)
        {
            if (themes.Count == 0)
            {
                return;
            }

            // Spacing between sections
            if (this.ThemesComboBox.Items.Count > 0)
            {
                this.ThemesComboBox.Items.Add(new ComboBoxItem { IsEnabled = false });
            }

            // Section header
            this.ThemesComboBox.Items.Add(new ComboBoxItem
            {
                Content = title,
                IsEnabled = false,
                FontStyle = FontStyles.Italic,
                FontWeight = FontWeights.Bold
            });

            // Themes in section
            foreach (Theme theme in themes)
            {
                ComboBoxItem item = new ComboBoxItem();
                item.Content = theme.Name;
                item.Tag = theme;
                this.ThemesComboBox.Items.Add(item);
            }
        }