CM is wonderful - it really does for your XAML app what a decent web framework like MVC does for a web app. We used PRISM on our last big WPF build at work (not my choice), and I had no hesitation in choosing CM for this current one (was my choice :)).
When you grab the latest nuget package, it comes with a Bootstrapper wired up to MEF. Tactfully side-stepping any religious arguments about whether MEF is actually an IoC container or not, if you would rather swap it out for Autofac, nInject or whatever, you can easily do this in this class. Throughout the framework, the various pieces will call into a static IoC class to resolve dependencies. When they do, calls will be routed to the bootstrapper, and your overrides will do the actual work. There are 3 methods to override in the Bootstrapper: GetInstance, GetAllInstances and BuildUp. The first two are (hopefully) obvious - the third is used to 'fill out' an instance of an object, e.g. If there are property dependencies to set, and is used in the coroutines piece. With all three, you can easily delegate the work to your container of choice, if MEF is not your thing... Lastly, you can also override the Configure() method to wire it all up, register all your dependencies in the container, etc... Hope this helps Cheers, Ian Randall @kiwipom From: [email protected] [mailto:[email protected]] On Behalf Of Greg Keogh Sent: Wednesday, 30 November 2011 8:03 p.m. To: 'ozWPF' Subject: RE: Getting up to speed in wpf Caliburn Micro and autofac have been mentioned in this forum a few times during the year with admiration. I'm now browsing the documentation on Caliburn Micro to get the hang of what it claims to do, and so far it makes sense and looks attractive. However, it might call itself "micro" but there's still a lot of stuff that will seem cryptic until I see clear examples or can get into the head of the authors. CB documentation shows how it uses MEF. I was just wondering what the relationship is between CB, MEF and autofac. Are there any dependencies between them? Don't MEF and autofac step on each other's toes a bit? Some clarification about this would be nice. I'll keep reading in the meantime. Cheers, Greg
_______________________________________________ ozwpf mailing list [email protected] http://prdlxvm0001.codify.net/mailman/listinfo/ozwpf
