This past weekend I downloaded Screenflow, which is a screencast application for the Mac. My goal was to create a new Unity and ASP.NET Screencast using Screenflow, but I need to spend a bit more time with Screenflow before I go into “production” with it. It is different enough from Camtasia, which I love, such that I need to iron out the use of Visual Studio 2008 in VMware Fusion, Apple Keynotes, the iSight Camera on the MacBook Pro, and the fact that I prefer to do the screencast using my external monitor and headset. Another week and I think I will have it all figured out.
In the meantime, I went ahead and created the screencast in Camtasia, which is a phenomenal screencast application for the PC. Therefore, if you are interested in seeing one way to get Unity IoC to work in ASP.NET Webforms for dependency injection into your pages, check out the following screencast:
You can also download the code presented in the screencast.
The screencast uses a similar technique to what you will find in the Web Client Software Factory, where you can derive your web pages from a base page class and then call UnityContainer.BuildUp on the page to do property injection into the page. Of course, the WCSF does not use Unity, but the techniques are similar. Although I don’t show it, you can use a similar technique for your MasterPages and UserControls.
Hopefully you find the screencast useful.
On a side-note, you might want to check out Ninject 1.0 – Lightning fast dependency injection for .NET, which I noticed was released in 1.0. You gotta love the contributions by the developer community.