You might have noticed that we forgot the “Main Menu” button in the page frame. Let’s add a button to the data template of the page frame:

If you run the program, you’ll see this:

The button is far too long and the font is far too small. Add another style for the button to the App.xaml file:

That looks better now but actually the main menu page shouldn’t have a button at all…

We need a Visibility property in the PageFrameVM class that the data template can bind to.
Add a MainMenuButtonVisibility property for the button to PageFrameVM:

Bind to this property from the data template for the PageFrameVM class:

Whether the main menu button should be displayed is actually depending on the page, so define the same property in the PageVM class:

Note: we give the property a default value of Visible, which means that the button is displayed by default, so we only have to take care of the pages, that don’t require the button, like our MainMenuPageVM:

Now when a new page is displayed, the page frame should get the MainMenuButtonVisibility from the new page and set it as the MainMenuButtonVisibility of the page frame:

Now the button should be gone…