/// <summary> /// Adds new views into the tabs. /// </summary> /// <param name="groups">The groups.</param> private void PopulateNewViews(Dictionary <string, List <ViewResult> > groups) { // Adding new items into the tabs foreach (var groupName in groups.Keys) { var group = groups[groupName]; if (group.Count < 1) { continue; } var groupTab = GetNewOrExistingGroupTab(group, groupName); if (groupTab.Content == null) { continue; } var subTabs = groupTab.Content as TabControl; if (subTabs == null) { continue; } foreach (var view in group) { var newSubTab = new HierarchicalViewHostTabItem { Content = view }; var foregroundBrush2 = SimpleView.GetTitleColor2(group[0].View); if (foregroundBrush2 != null) { newSubTab.Foreground = foregroundBrush2; } subTabs.Items.Add(newSubTab); subTabs.SelectedItem = newSubTab; } } }