zoukankan      html  css  js  c++  java
  • wpf资源引用 总结

    Pack URI方案:

    Pack://application,,, + [程序集名称;] + [可选版本号;] + [文件夹名称/]+文件名称

    Pack://application,,, 可以省略。

    [程序集名称];+[版本号] 有缺省值。

    所以常见的形式就是[文件夹/]文件名称

    同一程序集下面:

    //wpf相对路径

    <image Source =”test/Images/wheel.jpg”/>

    //wpf绝对路径

    <image Source =”pack://application:,,,/test/Images/wheel.jpg”/>

    //c#相对路径

    Uri imgUri = new Uri(@”test/Images/wheel.jpg”,UriKind.Relative);

    //C# 绝对路径

    Uri imgUri = new Uri(@” pack://application:,,,/test/Images/wheel.jpg”,UriKind.Absolute);

    不同程序集下面:

    1. 引用程序集

    可以忽略前缀的两种写法

    2. <image Source =”pack://application:,,,/Pack_1;component/test/Images/wheel.jpg”/>

    3. <image Source =”/Pack_1;component/test/Images/wheel.jpg”/>

    4. Uri imgUri = new Uri(@”/Pack_1;component /test/Images/wheel.jpg”,UriKind. Relative);

    5. Uri imgUri = new Uri(@” pack://application:,,,/Pack_1;component /test/Images/wheel.jpg”,UriKind.Absolute);

  • 相关阅读:
    简单学习tar命令
    方向
    简单使用ubuntu
    双网卡同时上内外网
    emacs学习中
    IE8的开发者工具
    emacs编辑html
    推荐一款数据恢复软件EasyRecovery
    慢慢的乐趣
    关于一个汽车调度的排车问题
  • 原文地址:https://www.cnblogs.com/aoldman/p/2807318.html
Copyright © 2011-2022 走看看