示例#1
0
 public void RemoveCustomTitleBar()
 {
     if (myTitleBar != null)
     {
         // Take the title bar's page content and make it
         // the window content.
         this.Content = myTitleBar.SetPageContent(null);
         myTitleBar   = null;
     }
 }
示例#2
0
        public void AddCustomTitleBar()
        {
            if (myTitleBar == null)
            {
                myTitleBar = new MyTitleBar();
                myTitleBar.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;
                myTitleBar.SetPageContent(mainContent);
                this.Content = myTitleBar;
            }
        }