Reputation: 71
hi anybody help how to write page navigation code for win8 metro apps in user control. I tried with following code it is not working.
this.Frame.navigate();
Upvotes: 1
Views: 795
Reputation: 725
If you are following an MVVM pattern with a framework like Caliburn Micro, MVVMLight, MicroMVVM then all of them provide a NavigationService of some sort which is usually used for navigation purpose. I would recommend you use that.
From the child control you can do this
var frame = Window.Current.Content as Frame;
frame.Navigate(typeof (Page2));
Where Page2 is the page you want to navigate to.
Upvotes: 3