O'Reilly logo

Building Enterprise Applications with Windows® Presentation Foundation and the Model View ViewModel Pattern by Raffaele Garofalo

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

The Command in WPF and Silverlight

One of the most interesting features in WPF and Silverlight is the ICommand interface and how it works. The ICommand interface exposes Execute and CanExecute methods that let you control the command execution. By using the binding engine in WPF or Silverlight and the ICommand implementation, you are able to place a ViewModel that exposes ICommand commands in the View, and bind controls such as Button, Link, and so on to these commands. The ICommand lets you control command execution based on changes that might occur in the ViewModel. For example, you might enable the Save command on a View only after the ViewModel has fired the OnPropertyChanged() method at least once.

Usually, you will need to expose these commands ...

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