Tutorial by Examples

The RelayCommand implements the ICommand interface and can therefore be used to bind to Commands in XAML (as the Command property of the Button element) The constructor takes two arguments; the first is an Action which will be executed if ICommand.Execute is called (e.g. the user clicks on the butt...
The RelayCommand<T> is similar to the RelayCommand, but allows to directly pass an object to the command. It implements the ICommand interface and can therefore be used to bind to Commands in XAML (e.g. as the Command property of the Button element). You can then use the CommandParameter prope...
The ObservableObject class contains some helpful methods to help with the MVVM pattern. The RaisePropertyChanged provides a compile safe method to raise property changed events. It can be called with RaisePropertyChanged(() => MyProperty); The Set method can be used in the property setter t...
ViewModelBase extends ObservableObject and adds some methods useful for viewmodels. The property IsInDesignMode or IsInDesignModeStatic allows to determine if the code is executed in the design mode (in Visual Studio Design View) or not. The two properties are exactly the same.

Page 1 of 1