本文介绍了在WPF最佳实践中重用资源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



在我的应用程序中,我使用了大量资源。我想在我的应用程序中重用资源。



我应该将每个资源创建为单独的文件和每个控件中的Merge资源。 (或)我必须在所有用户控件中复制资源(因为在单独的文件中创建每个资源增加dll大小)



例如:

ResourceA和ResourceB



ControlA中需要资源A,ControlB中需要资源B,ControlC中都需要资源A和



哪一个是最佳实践?



1.我应该为A和B创建单独的资源文件,以便更改资源将影响所有的地方

(OR)

2.创建一个公共资源文件并添加两个资源并合并所有控件中的资源。 (这里ControlA不需要资源B,ControlB不需要资源A)



请告诉我最佳实践。

Hi All,

In my application i am using lot of resources. I want to reuse the resource across my application.

Shall i create each resource as separate file and Merge resource in each control. (OR) I have to duplicate resource in all the user controls (Because creating each resource in separate file increase dll size)

For example:
ResourceA and ResourceB

Resource A is required in ControlA, Resource B is required in ControlB and Resource A and B both required in ControlC.

Which one is the Best practice?

1. Shall i create separate resource file for A and B so that changing the resource will affect all the place
(OR)
2. Create a common resource file and add both the resources and merge the resource in all the controls. (Here Resource B is not required for ControlA and Resource A is not required for ControlB)

Please Tell me the Best practice.

推荐答案


这篇关于在WPF最佳实践中重用资源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-06 00:39