O'Reilly logo

MVVM Survival Guide for Enterprise Architectures in Silverlight and WPF by Muhammad Shujaat Siddiqi, Ryan Vice

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

Lazy Initialization

During development, we will frequently use types that are resource-intensive for construction in terms of memory or computation time. So we might want to delay the construction of these types until we actually need them. This can be achieved by a new feature introduced in .NET framework 4.0, called Lazy Initialization. We can use this feature to improve the performance of our applications by delaying the instance construction of types.

Let's look at a sample window which is part of a contrived medical application. Let's create a WPF MVVM Light project, called MVVMAppLazyInitialization, in .NET Framework 4. In this sample, patients are selected and loaded, as shown in the following screenshot, so that their information can be ...

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