TheUnexpected
TheUnexpected

Reputation: 3177

Remove navigation bar from WPF Pages application

I have a WPF/XAML Window that navigates different Pages. The navigation is performed this way:

MainFrame.Navigate(new LoginPage(this));

The problem is that, at the first navigation, a bar appears on top of the Window:

enter image description here

How can I remove/hide it?

Upvotes: 3

Views: 6771

Answers (2)

Jason Min
Jason Min

Reputation: 1

If you use the Navigation window, Please use it.

ShowsNavigationUI="False"

Upvotes: 0

sbouaked
sbouaked

Reputation: 980

Step 1. In your Frame Tag Add the Event ContentRendered. as

 <Frame Name="myFrame" ContentRendered="myFrame_ContentRendered" ></Frame>

Step 2. In the ContentRendered event handler set the NavigationUIVisibility Hidden for each page instead on calling the same on all the pages as.

     private void myFrame_ContentRendered(object sender, EventArgs e)
    {
        myFrame.NavigationUIVisibility = System.Windows.Navigation.NavigationUIVisibility.Hidden;
    }

or simply use : <Frame Source="YOURPAGE.xaml" NavigationUIVisibility="Hidden" />

Upvotes: 10

Related Questions