WPF 动态资源示例
有没有例子可以清楚地说明静态资源和动态资源之间的区别。我知道静态加载一次并在启动时绑定的基本区别,而动态加载在运行时加载并在每次控件重新加载时重新绑定。
提前致谢
Is there any example which can clearly state the difference between Static and dynamic resource. I know the basic difference that Static is loaded once and gets binded at start while dynamic is loaded at run time and rebinded every time the control reloads.
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果在元素的应用程序运行时更改桌面颜色,则该元素将保持其原始颜色:
另一方面,如果使用 DynamicResource 设置元素的颜色,则它会在桌面颜色更改时更改:
If the Desktop Color is changed while the element’s application is running, the element keeps its original color:
On the other hand, if the element’s color is set using a DynamicResource, it changes when the Desktop Color changes:
So 本身提供了全面的资源。检查
WPF 中 StaticResource 和 DynamicResource 之间有什么区别?
还可以浏览
http://msdn.microsoft.com/en-us/library/ms750613.aspx
http://dedjo.blogspot.com/2007/05/staticresource-dynamicresource-xstatic.html
A comprehensive resource is available in So itself.Check
What's the difference between StaticResource and DynamicResource in WPF?
Also go through
http://msdn.microsoft.com/en-us/library/ms750613.aspx
http://dedjo.blogspot.com/2007/05/staticresource-dynamicresource-xstatic.html