wpf中资源字典和应用程序资源的区别是什么? [英] what is difference of resource dictionary and application resource in wpf?

查看:270
本文介绍了wpf中资源字典和应用程序资源的区别是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在资源字典和应用程序资源中编写样式和模板,它们之间有什么区别?帮助我

解决方案

一个是关于''全部'和'&另一个是关于''所有''可访问的。



资源可以作用域,即可以在应用程序层次结构的各个级别定义资源。

在某个范围内定义的资源可用于该范围内或该范围内的所有元素。应用程序资源在应用程序级别。



在大多数应用程序中,资源数量快速增长,必须在应用程序生命周期的早期进行管理。因此,资源字典用于对相关资源进行分组,然后将这些资源字典合并到应用程序或其他所需范围。



以下将详细解释您: [ ^ ]

i am write the style and template in both resource dictionary and application resource what is difference between them?. help me

解决方案

One is about ''what all'' & other is about ''where all'' accessible.

Resources can be scoped, i.e. resources can be defined at various levels of the application hierarchy.
Resources defined at a certain scope are available to all elements in or below that scope. Application resources are at application level.

In most applications, the number of resources grows quickly and must be managed early in the application lifecycle. Thus, Resource dictionaries are used to group related resources, then those resource dictionaries are merged at the Application or other required scope.

Following will explain you in detail: Creating and Consuming Resource Dictionaries in WPF and Silverlight[^]


这篇关于wpf中资源字典和应用程序资源的区别是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆