zoukankan      html  css  js  c++  java
  • 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 本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
  • 相关阅读:
    BAT脚本批量调用Sql执行文件 (SqlServer 数据库)
    树莓派系统刻录到首次登陆等问题
    数据库视图的使用
    MQ配置安装
    PLSQL集合类型
    PLSQL-包函数存储过程
    Oracle 字段拆分替换在合并成一条
    ORACLE-EXP和IMP方法介绍
    javascript几个月前的时间
    返回顶部实现方式
  • 原文地址:https://www.cnblogs.com/sunjunlin/p/2461167.html
Copyright © 2011-2022 走看看