问题
Im trying to create custom navigation manager for my WinRT app. All I want is a simple class I can use in MVVM that would enable me creation of navigation logic within XAML. My idea looks like this:
<Button Content="Details" Command="{Binding Navigate}"
CommandParameters="Page2.xaml"/>
In order to do this I found out there is Navigate(Uri uri)
in the Frame
class. With this method my dream would come true. The problem is there is no such method. The only method I can call on Frame
is Navigate(Type type)
.
Does anybody know, how can I call this Navigate(Uri uri) in WinRT?
回答1:
I believe you are on the right track. Instead of the Uri
you are supposed to use the type of the page class you are trying to navigate to.
Try something like this:
Frame.Navigate(typeof(YourPageClass));
回答2:
This method is in System.Windows.Controls.Frame assembly.
http://msdn.microsoft.com/en-us/library/system.windows.controls.frame.aspx
来源:https://stackoverflow.com/questions/11377434/where-is-frame-navigateuri-uri-method