Makes WPF ViewModel classes smart by default. Implements INotifyPropertyChanged and DelegateCommands for auto properties, recognises dependent properties, connects property changed handlers.
Probably every WPF project following the MVVM pattern (Model–View–ViewModel) has a class called “ViewModelBase” somewhere. It serves as base class for all ViewModel classes of the application and provides an implementation of the
INotifyPropertyChanged interface in most cases. This is at least, besides the event, a protected method like “OnPropertyChanged” or “RaisePropertyChanged”.
But that alone doesn’t make the programmer’s life easier yet when there are numerous classes with equally numerous properties to be implemented, with dependencies among them (computed properties).
Largely replacing my runtime-based ViewModelBase class, I have made a Fody add-in package that manipulates the assembly after compilation and adds these features directly into the assembly, as if you had written them in your source code, just that you have written nothing at all.
Future ideas are about adding data validation support once I figured out the way I want to use it.
There’s a public Git repository of ViewModelKit on GitHub. Changes to the code are documented there.
This software is released under the terms of the MIT licence. You can find the detailed terms and conditions in the download.
- Created on 2016-08-28.
- Ca. 1 800 lines of code, estimated development costs: 1 800 - 7 200 €