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

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12347806/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-13 05:17:29  来源:igfitidea点击:

Where to find XAML namespace d="http://schemas.microsoft.com/expression/blend/2008" mapping library?

wpfxamlnamespacesmappingxml-namespaces

提问by Tealc Wu

In every default WPF window as below, there are four namespaces referenced. I know:

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

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

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

and

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

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

are mapping library PresentationCore.dll and PresentationFramework.dll. But where can I find the library files mapping namespace

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

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

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

and

xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

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>

采纳答案by Tealc Wu

Almost correct. Please see more details in MSDN: http://msdn.microsoft.com/en-us/library/cc189061(v=vs.95).aspx

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

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

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

The d: XAML namespace is intended for designer support, specifically designer support in the XAML design surfaces of Microsoft Visual Studio and Microsoft Expression Blend. The d: XAML namespace enables designer attributes on XAML elements. These designer attributes only affect the design aspects of how XAML behaves. The designer attributes are ignored when the same XAML is loaded by the XAML parser in the Silverlight run-time, and the application runs. Generally, the designer attributes are valid on any XAML element, but in practice there are only certain scenarios where applying a designer attribute yourself is appropriate.

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

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

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

mc: indicates and supports a markup compatibility mode for reading XAML. Typically, the d: prefix is associated with the attribute mc:Ignorable. This technique enables run time XAML parsers to ignore the design attributes, as described previously.

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

回答by Mike-EEE

I am not sure this question has been answered yet, but I was able to find it on my local machine for Visual Studio 2013, Ultimate edition. You can find all the types (such as DataContextProperty or what I was looking for, DesignInstanceExtension) in an assembly somewhere on your machine with a path that looks like:

我不确定这个问题是否已经得到回答,但我能够在我的本地机器上找到它,用于 Visual Studio 2013,终极版。您可以在机器上某处的程序集中找到所有类型(例如 DataContextProperty 或我正在寻找的 DesignInstanceExtension),其路径如下所示:

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

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

Please note that this may vary depending on the version of Visual Studio you are using. I am just reporting what "works on my machine." Doing a machine-wide search for "Microsoft.Expression.Platform.dll" should do the trick.

请注意,这可能会因您使用的 Visual Studio 版本而异。我只是报告“在我的机器上有效”的内容。在机器范围内搜索“Microsoft.Expression.Platform.dll”应该可以解决问题。

回答by lookitskris

From my understanding, “d”namespace enables designer-only attributes in your code. This is so you can add stuff like design time data to your application and make it blendable.

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

The “mc” namespace supports compatibility and usually the “d”prefix mentioned above is paired with an “mc:ignorable” which tells the compiler to ignore the design time elements at runtime

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