O'Reilly logo

Windows Presentation Foundation 4.5 Cookbook by Pavel Yosifovich

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Building a simple MVVM framework

It should be clear at this point that MVVM-based applications have a lot of elements in common, such as change notifications and commands. It would be beneficiary to create a reusable framework that we can simply leverage in many applications. Although there are several good frameworks out there (most are free), building such a framework ourselves will enhance our understanding and may prove easier to extend than other frameworks, which we may be less familiar with.

Getting ready

Make sure Visual Studio is up and running.

How to do it...

We'll create a reusable class library to serve as a basis of a simple MVVM framework and use it (and extend it) in later recipes:

  1. Create a new WPF UserControl Class Library project ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required