Commands

Commands provide a means for encapsulating some logic, enabling that logic to be reused. One of the key benefits of commands, however, is that some controls allow you to bind to and execute them in XAML. In other words, not only can you bind to data in Silverlight but you can also bind to operations! For example, a ViewModel might expose a Save command, that a button in the View can bind to and execute when the button is clicked.

images Note Commands are commonly used in conjunction with the MVVM design pattern to allow a ViewModel to expose operations to a View.

Creating a Command

To create a command class, it must implement the ICommand ...

Get Pro Business Applications with Silverlight 5 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.