在哪里可以找到XAML命名空间d =“http://schemas.microsoft.com/expression/blend/2008”映射库?

时间:2012-09-10 08:24:53

标签: wpf xaml namespaces mapping xml-namespaces

在下面的每个默认WPF窗口中,引用了四个名称空间。 我知道:

  

xmlns =“http://schemas.microsoft.com/winfx/2006/xaml/presentation”

  

xmlns:x =“http://schemas.microsoft.com/winfx/2006/xaml”

是映射库PresentationCore.dll和PresentationFramework.dll。但是我在哪里可以找到映射名称空间的库文件

  

xmlns:d =“http://schemas.microsoft.com/expression/blend/2008”

  

的xmlns:MC = “http://schemas.openxmlformats.org/markup-compatibility/2006”

<Window x:Class="WpfApplication1.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    Title="MainWindow" Height="350" Width="525">
    <Grid>

    </Grid>
</Window>

3 个答案:

答案 0 :(得分:5)

几乎正确。请在MSDN中查看更多详细信息:http://msdn.microsoft.com/en-us/library/cc189061(v=vs.95).aspx

d:(http://schemas.microsoft.com/expression/blend/2008

d :XAML命名空间用于设计人员支持,特别是Microsoft Visual Studio和Microsoft Expression Blend的XAML设计界面中的设计器支持。 d :XAML命名空间在XAML元素上启用设计器属性。这些设计器属性仅影响XAML行为的设计方面。当Silverlight运行时XAML解析器加载相同的XAML并且应用程序运行时,将忽略设计器属性。通常,设计器属性在任何XAML元素上都是有效的,但实际上只有某些情况下自己应用设计器属性是合适的。

mc:(http://schemas.openxmlformats.org/markup-compatibility/2006

mc :表示并支持用于读取XAML的标记兼容模式。通常,d:前缀与属性mc相关联:可忽略。如前所述,此技术使运行时XAML解析器可以忽略设计属性。

答案 1 :(得分:3)

根据我的理解,“d”命名空间在代码中启用仅限设计器的属性。这样您就可以将设计时间数据等内容添加到应用程序中并使其可混合。

“mc”命名空间支持兼容性,通常上面提到的“d”前缀与“mc:ignorable”配对,告诉编译器在运行时忽略设计时元素

答案 2 :(得分:3)

我不确定这个问题是否已经得到解答,但我能够在我的本地计算机上找到Visual Studio 2013,Ultimate版本。您可以在计算机上的某个程序集中找到所有类型(例如DataContextProperty或我要查找的内容,DesignInstanceExtension),其路径如下所示:

C:\ Program Files(x86)\ Microsoft Visual Studio 12.0 \ Blend \ Microsoft.Expression.Platform.dll

请注意,这可能会因您使用的Visual Studio版本而异。我只是报告了什么&#34;在我的机器上工作。&#34;在机器范围内搜索&#34; Microsoft.Expression.Platform.dll&#34;应该做的。