Separate front-end and back-and-from executable

0

My idea is to separate the application into three different files, in the file MinhaAppBackend.dll , it will be, as the name suggests, all classes and other elements that are part of the application backend (Model, ViewModel, Daos etc ). In the MinhaAppFrontend.dll file everything will be related to the application's GUI (WPF) part (main window, dialogs, child windows, etc). The MinhaApp.exe file will only be the starting point of the application, it will only be responsible for calling the main window that is in the MinhaAppFrontend.dll library. Contrary to what most do is to leave the front-end in the .exe file with the main method generated at compile time. In my case it will be "dumb", it will have the only function of being the start of the application.

For the front end, my idea is a WPF User Control Library project, which compiles GUI elements (WPF) to dll . The project that will generate the .exe file references the dll containing the front-end and "calls" the main window. I have not yet implemented this "solution model", I just idealized it.

What do I want?

Know the opinion of the class about this idea of "solution design", that is, if this can bring me some problem or some extra difficulty or if it may be incompatible with the MVVM (analyzing without putting my hand in the mass I think who did not). I also want to know what the main method would look like to load and display the main window that is in dll .

I am posting the link for a demo project, in case anyone needs to see what I want in practice. The solution has two projects one deletes is a Console Application that generates one executable the other is a WPF User Control Library that generates a window in a dll.

    
asked by anonymous 15.07.2016 / 20:19

2 answers

1

Matheus in the case of WPF, try to work with MVVM, since WPF does not work with "Controllers". You can even use the same principle as the MVC framework, but for this you create directories that "house" the layers. To use this "window" inside MainWindow use the concept of UserControls in which you can create components and load them into the Window.

    
15.07.2016 / 20:35
0

You should make the Main project receive references from other projects, from there the Main access all public items from other projects.

Within the Main project, click References and Add Reference .

Inthewindowthatwillopen,chooseProjects>SolutionintheleftmenuandthenchecktheprojectsyouwanttoreferenceinMain

    
16.07.2016 / 22:28