public void RemoveCustomTitleBar() { if (customTitleBar != null) { // Take the title bar's page content and make it // the window content. this.Content = customTitleBar.SetPageContent(null); customTitleBar = null; } }
public void AddCustomTitleBar() { if (customTitleBar == null) { customTitleBar = new CustomTitleBar(); customTitleBar.EnableControlsInTitleBar(areControlsInTitleBar); // Make the main page's content a child of the title bar, // and make the title bar the new page content. UIElement mainContent = this.Content; this.Content = null; customTitleBar.SetPageContent(mainContent); this.Content = customTitleBar; } }