WPF XAML 命名空间导入

发布于 2024-08-26 05:36:54 字数 167 浏览 4 评论 0 原文

我发现为了在 XAML 中使用 PRISM 的类,您需要以这种方式导入命名空间: xmlns:cal="http://www.codeplex.com/CompositeWPF" 这种方式对我来说是新的,所以我想知道,超链接如何可以是命名空间导入的常用表示法的别名?那么智能知道应该在哪个程序集中搜索这个组件? 谢谢!

I've found that in order to use PRISM's classes in XAML you need to import namespace in that way:
xmlns:cal="http://www.codeplex.com/CompositeWPF"
this way is new to me, so I wanted to know, how hyperlink could be alias of usual notation of namespace import? so the intellisence knows in which assembly it should search this component?
Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

星光不落少年眉 2024-09-02 05:36:54

如果您在 AssemblyInfo.cs 文件中查找感兴趣的程序集,通常会发现有一个程序集属性将 URI 映射到 CLR 命名空间。下面是一个示例:

[assembly: XmlnsDefinition("http://www.dummy.com/Stuff",
                           "Dummy.Common.UI")]

您也可以将多个映射组合到同一 URI:

[assembly: XmlnsDefinition("http://www.dummy.com/Stuff",
                           "Dummy.Common.UI")]
[assembly: XmlnsDefinition("http://www.dummy.com/Stuff",
                           "Dummy.Common.UI.Controls")]

这些映射甚至可以跨程序集...您可以使用相同的 URI 来映射来自多个程序集的名称空间。

自己使用这个也很有帮助!非常方便。

If you look in the AssemblyInfo.cs file for an assembly you are interested in, there is typically an assembly attribute that maps a URI to a CLR namespace. Here's an example:

[assembly: XmlnsDefinition("http://www.dummy.com/Stuff",
                           "Dummy.Common.UI")]

You can combine multiple mappings to the same URI as well:

[assembly: XmlnsDefinition("http://www.dummy.com/Stuff",
                           "Dummy.Common.UI")]
[assembly: XmlnsDefinition("http://www.dummy.com/Stuff",
                           "Dummy.Common.UI.Controls")]

These can even cross assemblies... you can use the same URI to map namespaces from multiple assemblies.

It's helpful to use this yourself as well! It's pretty convenient.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文