我需要根据以下内容导航到特定页面:
Frame rootFrame = Window.Current.Content as Frame;
rootFrame.Navigate(typeof(rootFrame.Name));
但是rootFrame.Name =所需的页面名称是字符串而不是帧 任何帮助!!
答案 0 :(得分:0)
尝试:
public void NavigateToPage<T>()
{
var type = typeof(T);
var testvalue = (type.FullName.Substring(type.FullName.IndexOf('.')).Replace('.', '/')) + ".xaml";
RootFrame.Navigate(new Uri(testvalue, UriKind.Relative));
}