Applies to Silverlight 3, 4, 5 and WP7
Up until now, we've passed through click events (or other events) by setting up a handler in the code behind of our View. In this view, we then cast the DataContext to a specific
ViewModel type, which contains the implementation of the handler.
This is easy, but it's not the way to go in MVVM. By doing this, you're adding in some extra tight coupling between your View and ViewModel, which is exactly what MVVM tries to avoid. A better way to tackle this problem is by using commands. This will allow you to bind an event on your View to a command on your ViewModel, thus eliminating the need to pass through events via the code behind your View.
In this recipe, ...