Pro WPF and Silverlight MVVM

Effective Application Development with Model-View-ViewModel

By Gary Hall

Pro WPF and Silverlight MVVM Cover Image

WPF and Silverlight are unlike any other user interface (UI) technologies. They have been built to a new paradigm that—if harnessed correctly—can yield unprecedented power and performance. This book shows you how to control that power.

Full Description

  • ISBN13: 978-1-4302-3162-2
  • 272 Pages
  • User Level: Intermediate to Advanced
  • Publication Date: December 28, 2010
  • Available eBook Formats: EPUB, MOBI, PDF
  • Print Book Price: $54.99
  • eBook Price: $38.99
Buy eBook Buy Print Book Add to Wishlist

Related Titles

Full Description

WPF and Silverlight are unlike any other user interface (UI) technologies. They have been built to a new paradigm that—if harnessed correctly—can yield unprecedented power and performance. This book shows you how to control that power to produce clean, testable, maintainable code.

It is now recognized that any non-trivial WPF or Silverlight application needs be designed around the Model-View-ViewModel (MVVM) design pattern in order to unlock the technology's full data-binding potential.

However, the knowledge of how to do this is missing from a large part of the development community—even amongst those who work with WPF and Silverlight on a daily basis. Too often there is a reliance on programmatic interaction between controls and not enough trust in the technologies' data-binding capabilities. This leads to a clouding of design values and an inevitable loss of performance, scalability, and maintainability throughout the application.

Pro WPF and Silverlight MVVM will show you how to arrange your application so that it can grow as much as required in any direction without danger of collapse.

What you’ll learn

  • Understand why the separation of an application’s View and its Model is paramount, including the history of Model-View-Presenter and Model-View-Controller.
  • Apply WPF and Silverlight’s powerful data-binding model correctly.
  • Examine how to organize an application targeting WPF or Silverlight, including unit-testing, source-control, separation of concerns, data serialization, and how to tie everything together with MVVM.
  • Develop a full game development application using MVVM by example.
  • How to serialize the Model without being invasive, how to implement a plug-in architecture that extends both the View and the Model, and how to handle Exceptions gracefully.

Who this book is for

Developers that wish to learn how to architect WPF or Silverlight applications to ensure maintainability, testability, and separation of concerns.

Table of Contents

Table of Contents

  1. Overview of WPF and Silverlight
  2. DataBinding
  3. Model-View Separation
  4. The ViewModel
  5. Events and Commands
  6. Validation
  7. Unit Testing
  8. Data Access Layer
  9. Application Support
  10. Sample Application
Source Code/Downloads

Downloads are available to accompany this book.

Your operating system can likely extract zipped downloads automatically, but you may require software such as WinZip for PC, or StuffIt on a Mac.

Errata

Please Login to submit errata.

On page 81:
Installing the downloaded template results an error when creating a project.

The downloaded wizard is not the same as in the book and it's not working properly

Is there an new version available ??

On page 81 ff. Chapter 4:
Hi,

the Visual Studio MVVM Project Template being part of the source code archive which can be downloaded, does not correspond to the one described in the book.
The book describes the calculation of square roots wheras the online template deals with calculation of sums.

Please be so kind and verify it.

At present it is therefore impossible to follow the example which is described in the book.

On page 85:
The text on page 85 states that the view model project contains presentationcore and windowsbase references but Figure 4-6 does not show this.

On page 96:
In C#, unlike in C, you can't test a conditional for zero.

"Appointment appointment = e.Item as Appointment;
if(appointment)"

Should read:

"Appointment appointment = e.Item as Appointment;
if(appointment != null)"


On page 100:
"if(dialogResult)"

should be

"if(dialogResult.HasValue && dialog.Value)"

a nullable type does not convert directly to the type without casting or using it's Value property.


On page 100:
"if(dialogResult)"

should be

"if(dialogResult.HasValue && dialogResult.Value)"

a nullable type does not convert directly to the type without casting or using it's Value property.


On page 185:

In the introduction to Chapter 9: Application Support, 4 application support "modules" are said to be discussed. Listed are: the serialization of the object graph, implementing a data access layer, allowing users to configure the behavior and settings of the application, and adding extensibility via plug-ins.

Of these subjects, only serialization and extensibility are actually covered in the chapter.

On page 208:
line from operator + should be:
return new Money(lhs.Amount + rhs.Amount);