AvalonDock 如何引用自己的程序集?

发布于 2024-12-15 09:25:05 字数 441 浏览 6 评论 0原文

http://avalondock.codeplex.com/SourceControl/changeset/view/62498#1218343

<ResourceDictionary Source="/AvalonDock;component/Resources/Common.xaml"/>

对于 ResourceDictionary 的 Source 属性的语法或 XAML 的编译方式,一定有一些我不理解的地方。我想将 AvalonDock 的源代码直接插入到项目中,但似乎它的一些 XAML 文件引用了“AvalonDock 程序集”。

怎么会这样呢?

http://avalondock.codeplex.com/SourceControl/changeset/view/62498#1218343

<ResourceDictionary Source="/AvalonDock;component/Resources/Common.xaml"/>

There must be something I don't understand about either the syntax of a ResourceDictionary's Source property, or how XAML is compiled. I'd like to insert AvalonDock's source directly into a project, but it seems like some of its XAML files reference "the AvalonDock assembly".

How can this be?

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

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

发布评论

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

评论(2

雪若未夕 2024-12-22 09:25:05

ResourceDictionary 的属性实际上是一个 Uri 本质上代表资源的路径。在本例中,它只是表示查看 AvalonDock 程序集并找到 Common.xaml 文件。有关详细信息,请参阅在 WPF 中打包 URI

如果您想在项目中包含 AvalonDock 源,则应将 URI 的 /AvalonDock; 部分替换为您的项目之一(如果您将 Common.xaml 文件放在与在 AvalonDock 项目中)。

The Source property of the ResourceDictionary is actually a Uri which essentially represents a path to a resource. In this case, it just says to look in the AvalonDock assembly and find the Common.xaml file. See Pack URIs in WPF for more info.

If you want to include the AvalonDock source in your project, you should replace the /AvalonDock; part of the URI with the one of your project (if you put the Common.xaml file in the same directory as in the AvalonDock project).

花期渐远 2024-12-22 09:25:05

由于资源解析可能来自任何其他程序集,因此源实际上包含资源存在的程序集的名称。因为当你的应用程序运行时,.net 将如何找出从哪个程序集加载 URL?

Since resolution of resources may happen from any other assembly, the source actually contains name of assembly where resource exist. Because when your app is running, how .net will find out from which assembly to load the URL?

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