samedi 9 janvier 2016

Can a WinForms Startup Form Be Used As The Composite Root For The Unity Container

Vote count: 0

I have a WinForms application setup as an N-Layered solution in Visual Studio. I would like to use the first startup form in this WinForms application as the location where my Unity registrations and Resolves take place. This would be right in the initialization step as the form is beginning to startup. If I place the Unity setup here then I won't need to be concerned about passing in parameters to the startup form from a separate project. The startup form is basically the main form of all forms in the WinForms application. All other forms are spawned from the main form either directly or indirectly.

If Unity is setup in the main form, I can register all the interface classes intended to be injected into all other sub forms and project classes here. Would doing this cause any serious problems or would this approach work out fine?

I like this approach because it would mean I don't have to have a separate project created just for the purpose of setting up Unity and having to register all interface classes in that project to be passed to the first startup form.

asked 1 min ago

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.



Can a WinForms Startup Form Be Used As The Composite Root For The Unity Container

Aucun commentaire:

Enregistrer un commentaire