Where is Frame.Navigate(Uri uri) method?

懵懂的女人 提交于 2019-12-24 16:29:44

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!