开发者

Need advice on organizing two WPF applications within one Visual Studio solution

I have a WPF application (KaleidoscopeApplication) organized as follows:

  • Solution (6 projects)
    • Cryptography (DLL)
    • Rfid (DLL)
    • KaleidoscopeApplication (buildable "startup project")

Basically, KaleidoscopeApplication contains a bunch of resources (sounds, images, etc) and your standard WPF junk (App.xaml, App.xaml.cs, other xaml and code).

I need to create a new application that is very similar to Kaleidoscope, but I'm not sure of the best way to organize. This new app will need access to much of the same code and resources as Kaleidoscope. Preferably, I would like to create a new project in the solution, then simply use the "set as startup project" to pick which app I want to build. However, will I be able to access (share) the Resources folder of Kaleidoscope?

I know I will be able to acces开发者_开发技巧s much of the code if I simply add a reference to the project and include a "using Kaleidoscope". But the resources I'm not so sure about.

Is this the right way to organize or am I asking for trouble in the future?

Thanks in advance!


The recommended solution in this case would be to refactor the resources and any common required code into a separate Assembly that both UI applications could use. You will probably need to do some manual tweaking to make sure everything is exposed the way you need it to be, but it'll make things cleaner in the long run.


I agree with Dan about this. You definitely need a common type of project to put all those shared classes and resources, and one for your start up. From there, you can easily add new projects by following the same kind of pattern of separation of concerns.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜