The most interesting thing is that the use of the original Commands concept from WPF is absolutely not required :). You could build large and complex applications with all this beauty of loosely coupled design (xaml) and business logic (C # / vb code) in place using only MVVM and the free open source framework library Caliburn.Micro .
Disclaimer I am just a happy user of this library and have nothing to do with its creators, so these are not paid ads or anything like that.
Please just view this very simple sample from the official documentation :
-> Basic configuration, actions and conventions <-
and you can fill in strong binding events from your XAML view directly to the methods in your C # view model without a mess of proxy code for declaring commands and registering (for example, this is implemented in other similar applications).
And it doesn't matter that this example is a Silverligh application - Caliburn.Micro supports all major Xaml platforms in almost the same way, and the WPF sample will look the same as above, based on Silverlight.
In addition to the mentioned main features (binding to methods) Caliburn.Micro have:
- handy predefined naming conventions for binding that leave your XAML files clean and readable (and yet design friendly)!
- basic implementation of INotifyPropertyChanged so you can simply inherit all your view models from it
- basic classification for implementing commonly used scenarios, such as:
- master part
- parent-child
- list with selected items
- EventAggregator for an even more loosely coupled relationship between view models and other classes.
- loosely coupled support for things like keyboard focus and window management (for WPF)
- and a little more :)
Just give it a shot and you will never need WPF vanilla commands;)
source share