title: Where Do I Declare Unity Container?
body: <p>I'm just getting started with Unity, and I'm having trouble finding any advice about where to declare my UnityContainer object.  Most of the examples that I've seen consist of just a single method where the UnityContainer object is declared at the top, then its mappings are defined, then a few object types are resolved.  But how do you handle the container when you need to access it in several places throughout the program?  For example, the user clicks on a button which opens a new window and that window needs a controller, which itself needs to resolve several services?  I also want some of the services that Unity manages to be singletons, so wouldn't that mean that I'd have to have only a single instance of my UnityContainer throughout my program to manage those singletons?</p>
  
  <p>My first thought is to have my main Program class have a static UnityContainer property or expose some sort of UnityContainerFactory class which manages a singleton UnityContainer instance, but both of those methods seem bad because they create a global property which a lot of things are dependent on.</p>
  
  <p>What's the accepted way of doing this?</p>