- Dec 12, 2013
- 25
- 0
- 0
Looked through all the MSDN tutorials to find how to navigate to another page and use the back button to go back to the last page, however, when testing it didn't do anything. Not even the code I wanted only the XAML code.
var rootFrame=Window.Current.Content=new Frame();
rootFrame.navigate(typeof(MainWindow));
(rootFrame.Content as Page).DataContext=new MainViewModel(new MainModel());
HardwareButtons.BackPressed=((sender, args)=>{/*TODO: Navigate backwards*/args.Handled=true;});