문제

I have a a WPF prism desktop app with a few modules. I've put all the common images in a resources project and referenced it in all modules (it sorts of break modularity). Is this the right way of doing it or having a module specific resources would be better (this will increase duplication though).

All thoughts appreciated.

도움이 되었습니까?

해결책

I use a library called Commons.Styling which contains all common aspects of the applications appearance like WPF styles, color and brush repositories, fonts and all sorts of common images and icons. It doesn't break modularity by any means, as you can still use internal resources in the other modules. Where to draw the line between the common and the module specific part has to be decided by you, of course. It is always a matter of personal style and circumstances (i.e. is the application already shipped, is it easier to exchange the module library rather than updating the common libraries on a customer machine, etc...).

Long story short: Having a central styling project which also contains common image resources makes total sense. Nonetheless you should place module specific resources inside the module itself.

And just as an inspiration, here is my styling project structure:

Styling project

The files Assets.xaml and Icons.xaml are resource dictionaries for images and icons only, which I merge into the central resource dictionary, called IncaDesign.xaml, in this particular case.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top