Navigation is only supported to relative URIs that are fragments, or begin with '/', or which contain ';component/'. Parameter name: uri
突然遇到这烦恼的问题,由于心情不好,导致处理了好久。
解决办法:
1.从简单的路径检查: /page1.xaml, .../page.xaml
2.从程序集检查:
var nameHelper = new AssemblyName(Assembly.GetExecutingAssembly().FullName);
var version = nameHelper.Version;
var full = nameHelper.FullName;
var name = nameHelper.Name;
3.从URLmap检查:
<navigation:UriMapper x:Key="UriMapper"> <navigation:UriMapper.UriMappings> <navigation:UriMapping Uri="" MappedUri="/MainPage.xaml"/> <navigation:UriMapping Uri="/{pageName}" MappedUri="/Views/{pageName}.xaml"/> <navigation:UriMapping Uri="/{pageName}/{key}" MappedUri="/Views/{pageName}.xaml?entityGuid={key}"/> </navigation:UriMapper.UriMappings> </navigation:UriMapper>
真正解决:
在异常退出发现:
private void RootFrame_NavigationFailed(object sender, NavigationFailedEventArgs e) { if (System.Diagnostics.Debugger.IsAttached) { // A navigation has failed; break into the debugger System.Diagnostics.Debugger.Break(); } }
其中的naveigationFailedEventArgs e的e显示 no xaml in view/setting.
说明我设置了Url map,但没有写好导航的格式。
至此问题解决。
作者:johnny
出处:http://www.cnblogs.com/sunjunlin
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。