Home > other >  WPF Application = Exe DLL Custom Visualizer ? Can I do all 3 of them?
WPF Application = Exe DLL Custom Visualizer ? Can I do all 3 of them?

Time:01-04

As the title says, I have a WPF form that I want to build in 3 separate projects:

  1. A Windows application, used standalone by clicking the .exe file
  2. A GUI control that can be imported and used in some other projects (dll)
  3. A Custom Visualizer, that can also be used to view a collection of some specific types (dll)

The interface and all the functionality will be the same(identical) between the 3 projects

My questions are the following:

  • Can this be achieved by making only one project? Or do I have to make 3 separate projects?
  • If there is not other way but to make 3 separate projects, how can I have the logic for the controls in a separate project common for all of them? All the logic is now in the controls events (MouseWheel, button click etc)
  • I need to use net framework 4.7.2 (or 4.8). Can I make all the projects with this? Or can I also use .net 6.0 on some of them?

Thank you

CodePudding user response:

In such case, you can use a Shared Project. Add a Shared Project (case-sensitive) to your solution and reference that project from other pojects. Then you can access the code inside the Shared Project from other projects as if the code belongs to each of other projects.

Shared Project is often explained in the context of sharing the codes among different platforms but it could be useful for other purpose as well.

  • Related