AvalonDock 如何引用自己的程序集?
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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
源
ResourceDictionary
的属性实际上是一个Uri
本质上代表资源的路径。在本例中,它只是表示查看AvalonDock
程序集并找到Common.xaml
文件。有关详细信息,请参阅在 WPF 中打包 URI。如果您想在项目中包含 AvalonDock 源,则应将 URI 的
/AvalonDock;
部分替换为您的项目之一(如果您将 Common.xaml 文件放在与在 AvalonDock 项目中)。The
Source
property of theResourceDictionary
is actually aUri
which essentially represents a path to a resource. In this case, it just says to look in theAvalonDock
assembly and find theCommon.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).由于资源解析可能来自任何其他程序集,因此源实际上包含资源存在的程序集的名称。因为当你的应用程序运行时,.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?