Jeff Brand has posted a simple example of Dependency Injection.
Source: SlickThought.Net
Let’s start by painting a simple scenario: I have a ViewModel that lists a collection of data items. Let’s say a list of Tweets based on a given hash tag search. The ViewModel has a SaveCommand that I will wire into my view. When the user causes the SaveCommand to execute, the ViewModel will leverage some service to persist the selected tweet to some form of storage. And there is the rub… Maybe in v1, I will save that tweet in IsolatedStorage, but in the future, I will want to also provide an option to select a cloud-based storage solution. This is is where we start to hear all kind of things about Dependency Injection, IoC, and more.
Source: Timmy Kokke's Blog
There are numerous Dependency Injection Frameworks. For this tutorial I’ve chosen Ninject. The main idea on how to implement DI in your application is pretty much the same for all frameworks. In this tutorial I hope I can give you a small introduction in using Ninject in you projects. Ninject is an open source project which can be found at www.ninject.org. Ninject is also available through the NuGet tool in Visual Studio. Have look at my NuGet tutorial on how to get it through that.