locked
How to remove history/navigation from a WPF Frame RRS feed

  • Question

  • Hello,


    i have a WPF Window, and on pressing Button A i want to display some content in a certain area of my window.
    when pressing "Button B" the content shall disappear and other content shall appear on that place instead.

    i tried to use the Frame control for that:
    i defined 2 WPF Pages (one for content of Button A and one for content of Button B), and on pressing the button the frame.Content was set to the desired page.
    But unfortunately as soon as i reset the content to something else i get the navigation bar.
    is there a way how i can remove that navigation pane?  i only want the contents of the page visible and no navigation.


    Tuesday, August 11, 2009 4:08 PM

Answers

  • Hi,
    You should set the ShowsNavigationUI=false in the Page.

    Hope it helps.

    Regards,
    Federico Benitez My blog
    • Proposed as answer by Federico Benitez Tuesday, August 11, 2009 8:34 PM
    • Marked as answer by Phelyks Wednesday, August 12, 2009 8:31 AM
    Tuesday, August 11, 2009 4:12 PM
  • Thanks for the reply!

    I had to do some more though:
    after setting above property as well as

    frame.NavigationUIVisibility = NavigationUIVisibility.Hidden;


    the pane was hidden.

    case solved!  ;)

    • Marked as answer by Phelyks Wednesday, August 12, 2009 8:30 AM
    Wednesday, August 12, 2009 8:30 AM

All replies

  • Hi,
    You should set the ShowsNavigationUI=false in the Page.

    Hope it helps.

    Regards,
    Federico Benitez My blog
    • Proposed as answer by Federico Benitez Tuesday, August 11, 2009 8:34 PM
    • Marked as answer by Phelyks Wednesday, August 12, 2009 8:31 AM
    Tuesday, August 11, 2009 4:12 PM
  • Thanks for the reply!

    I had to do some more though:
    after setting above property as well as

    frame.NavigationUIVisibility = NavigationUIVisibility.Hidden;


    the pane was hidden.

    case solved!  ;)

    • Marked as answer by Phelyks Wednesday, August 12, 2009 8:30 AM
    Wednesday, August 12, 2009 8:30 AM
  • thanks!  I've been banging my head against a brick wall for a week trying to work out why ShowsNavigationUI wasn't doing anything.. the NavigationUIVisibility option appears to be barely documented.

    IMO this stuff should be off by default - 99% of the time people are not writing browsers.

     

    Saturday, July 9, 2011 6:43 PM
  • I agree that this stuff should be off by default, accept that then no one would know that it's there. What I want to know is how do I turn off the Frame's journal keeping functionality. Navigation journal keeping takes up resources that I don't need in my application. I used to be able to disable this within the XAML.

    Thanks.
    Wednesday, September 9, 2015 7:16 PM
  • If you don't need the journal keeping then you pretty much may as well just use a contentcontrol instead of a frame.

    Set the content to an instance of your page/usercontrol. 


    Wednesday, September 9, 2015 7:27 PM
  • Use this Code in Page Load Event to Remove Back Entries and to show only current page

    this.NavigationService.RemoveBackEntry();

    • Proposed as answer by Page404 Friday, March 20, 2020 12:27 PM
    Monday, February 18, 2019 5:49 AM
  • i used the Navigated event:

            void frframe_Navigated(object sender, System.Windows.Navigation.NavigationEventArgs e)
            {
                frframe.NavigationService.RemoveBackEntry();
            }

    works great thanks. My memory leak is gone! -.-''


    Friday, March 20, 2020 12:29 PM