/// <summary> /// Responsible for ensure mutually exlusive option sets /// are displayed in seperate tabs. /// </summary> /// <param name="aggs"></param> /// <returns></returns> private UIElement genTopLevelFrame(List <Aggregate> aggs) { //generate compositor UI element. TabControl tabs = new TabControl(); int count = 0; //generate all ui components. foreach (var aggregate in aggs) { if (aggregate.aggregation != null && aggregate.aggregation.Count > 0) { //generate subcomponents. var opts = genFrame(aggregate.aggregation); TabItem tbi = new TabItem(); if (count == 0) { tbi.Header = "Coarse Configuration"; count++; } else { tbi.Header = "Granular Configuration"; } tbi.Content = opts; //create event mapping. mUIToAggregation.Add(tbi, aggregate); tabs.AddHandler(TabControl.SelectionChangedEvent, new RoutedEventHandler(onSetChange)); //default. tabs.SelectedIndex = 0; //add to compositor. tabs.Items.Add(tbi); } } return(tabs); }
public SpedPrincipal() { InitializeComponent(); TabPrincipal = TabControlPrincipal; TabPrincipal.AddHandler(CloseableTabItem.CloseTabEvent, new RoutedEventHandler(this.CloseTab)); }