![](/img/trans.png)
[英]How to navigate frame on image tapped in a user control Universal Windows App?
[英]How to navigate between pages in windows universal app?
@阿吉特,
是的,您可以使用以下方法在页面之间导航:
currentFrame.Navigate(typeof(NextPage));
如果 currentPage 不是这个,你可以在下面的帮助类中找到它。
它允许导航,甚至从 ViewModel 类:
public class NavigationExtension
{
public static void Navigate(Type typeOfPage)
{
Windows.UI.Xaml.Window window = Windows.UI.Xaml.Window.Current;
if (window != null)
{
Windows.UI.Xaml.Controls.Frame frame = window.Content as Windows.UI.Xaml.Controls.Frame;
if (frame != null)
{
frame.Navigate(typeOfPage);
}
}
}
}
问候
如果您想转到另一个页面并且不想回来,请使用以下代码:
Frame rootFrame = Window.Current.Content as Frame;
rootFrame.Navigate(typeof(Your Page Name));
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.