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);
}
}