I needed something like this - the ability to have my main frame go back to the previously shown page. In other words, do exactly the same thing that pressing the back button would do, but do it in response to something else (i.e.: show a page, and when
a selection is made on that page, simply return to the previous page)
What I did to accomplish this was to obtain the Content frame in my MainWindow.cs like so:
private ModernFrame f;
public override void OnApplyTemplate()
f = (ModernFrame)GetTemplateChild("ContentFrame");
and also have my MainWindow register for a NavigateBackMessage that any one of my Page's viewmodels could send.
Messenger.Default.Register<NavigateBackMessage>(this, m => ReceiveNavigateBackMessage(m));
and upon receipt of the message I do:
private void ReceiveNavigateBackMessage(NavigateBackMessage m)
and that's it.