Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove navigation bar from WPF Pages application

Tags:

c#

wpf

xaml

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?

like image 440
TheUnexpected Avatar asked Mar 02 '26 02:03

TheUnexpected


1 Answers

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" />

like image 61
sbouaked Avatar answered Mar 03 '26 14:03

sbouaked



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!