c# – WPF应用程序中资源和内容之间的区别是什么

我最近了解到嵌入式资源意味着资产被保存到外部.resx文件中.

将资源设置为Resource使它们只是简单地加入.exe文件.

现在,我对何时使用内容和资源感到困惑.

任何信息?

解决方法

Resource : Embeds resource into the
assembly (or culture specific
satellite assembly)

Content : this leaves resource as
loose file and upon compilation this
resource information is not embedded
to assembly. Instead,it adds custom
attribute to the assembly
(AssemblyAssociatedContentFile) which
records the existence and relative
location of file.
It is also possible
to access the resource file without
adding into the project. However,with
this approach management of resource
file becomes bit difficult. However,
this approach is useful if resource
file is generated dynamically using
some runtime information. In such a
case,resource file will not be
available at compile time so can not
be added to project.

资料来源:Resources in WPF.

相关文章

在要实现单例模式的类当中添加如下代码:实例化的时候:frmC...
1、如果制作圆角窗体,窗体先继承DOTNETBAR的:public parti...
根据网上资料,自己很粗略的实现了一个winform搜索提示,但是...
近期在做DSOFramer这个控件,打算自己弄一个自定义控件来封装...
今天玩了一把WMI,查询了一下电脑的硬件信息,感觉很多代码都...
最近在研究WinWordControl这个控件,因为上级要求在系统里,...