public void AddTab(Tab tab) { tab.PropertyChanged += new PropertyChangedEventHandler(tab_PropertyChanged); pnlHeaders.Children.Add(tab); if (tab.IsSelected) ProcessSelectedTab(tab); }
private void ProcessSelectedTab(Tab tab) { foreach (Tab t in pnlHeaders.Children) t.IsSelected = t == tab; pnlContent.Children.Clear(); if (tab.Tag != null) pnlContent.Children.Add(tab.Tag); if (SelectedTabChanged != null) SelectedTabChanged(this, EventArgs.Empty); }