Siva Rajagopal
Siva Rajagopal

Reputation: 71

page Navigation code on user control class file

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

Answers (1)

Zubair Ahmed
Zubair Ahmed

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

Related Questions