public void SetHeader(UIElement header) { DockPanel dockPanel = new DockPanel(); dockPanel.Children.Add(header); CTB = new CloseTabButton(); RTB = new RefreshTabButton(); //closeButton.Click += (sender, e) => dockPanel.Children.Add(RTB); dockPanel.Children.Add(CTB); // Set the header Header = dockPanel; }
public void SetHeader(UIElement header) { // Container for header controls DockPanel dockPanel = new DockPanel(); dockPanel.Children.Add(header); // Close button to remove the tab CloseTabButton closeButton = new CloseTabButton(); closeButton.Click += (sender, e) => { ItemsControl tabControl = Parent as ItemsControl; tabControl.Items.Remove(this); }; dockPanel.Children.Add(closeButton); // Set the header Header = dockPanel; }