替换“动态资源”与“静态资源”

发布于 2024-09-18 13:31:01 字数 232 浏览 3 评论 0原文

为了实现我的应用程序,我使用了很多 Blend3。当 Blend3 想要将一个资源链接到另一个资源时,它会多次使用链接类型“DynamicResource”。正如我所理解的(但我可能理解得不太好),只有当我想在运行时修改链接时,“动态”链接才有意义。在其他情况下,他们徒劳地使用更多内存。我不想在运行时修改任何内容,那么问题是:在我的所有应用程序中用“StaticResource”替换“DynamicResource”是否有意义? 谢谢你! 皮莱吉

To realize my application I have used a lot Blend3. When Blend3 wants to link a resource to another resource, it uses many times the link-type "DynamicResource". As I have understood (but I could have understood not well), the "Dynamic" links have sense only if I want to modify the links at runtime. In other cases they use more memory in vain. I don't want to modify anything at runtime, then the question is: have sense to replace "DynamicResource" with "StaticResource" in all my application?
Thank you!
Pileggi

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

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

发布评论

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

评论(1

情深如许 2024-09-25 13:31:01

Blend 在设计时使用 DynamicResource 效果更好。请参阅:

http:// /blogs.msdn.com/b/unnir/archive/2009/03/31/blend-wpf-and-resource-references.aspx

报价如下:

a) 我应该使用静态还是动态
资源查找?

混合定义。戏剧
动态资源查找效果更好。
您可以使用静态资源查找
只要资源不存在
位于或合并到 App.xaml 中。
人们对周围提出了担忧
动态性能问题
资源查找(你为你的资源付费
得到)。虽然这可能是真的,但
有趣的数据点是
Expression Blend 源代码使用
ton 使用动态资源查找
我们自己的 UI(当然,我们也使用
地方的静态资源查找
资源永远不会改变的地方,
或者在不可能使用的地方
动态资源扩展,用于
非 DP 示例)。

Blend works better in design time with DynamicResource. See:

http://blogs.msdn.com/b/unnir/archive/2009/03/31/blend-wpf-and-resource-references.aspx

The money quote from that:

a) Should I use Static or Dynamic
resource lookup?

Blend def. plays
better with dynamic resource lookups.
You could use a static resource lookup
as long as the resource was not
located or merged into App.xaml.
People have raised concerns around
performance issues with dynamic
resource lookups (you pay for what you
get). While that might be true, an
interesting data point is that the
Expression Blend source code uses a
ton uses dynamic resource lookups for
our own UI (of course, we too use
static resource lookups in places
where the resource would never change,
or where it not possible to use a
dynamic resource extension, for
example non-DPs).

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