A Platform-Agnostic Dialog Service
Over the past few years, I have found myself doing a lot of cross-platform development, in particular Silverlight for the browser, WPF, and now Windows Phone development. Being able to abstract common tasks away from technology specific types, such as displaying simple dialogs, has made reusing code far easier. In addition, mocking things, which would otherwise cause a unit test to fail on a build server, such as displaying a message box, has proven invaluable.
In several places throughout the book you see the use of an
IMessageService, which is used to display message dialogs to the user. The
ViewModelBase class exposes the
IMessageService as a
MessageService property, and you see calls like the following: ...