Toolkit Architecture
Hierarchy of Viewmodel Base Classes
MugenMvvm has a bunch of base view models for different usage scenarios:
ViewModelBase
- base class for all ViewModels. Contains methods for creation of others ViewModels, methods for message passing beetwen VMs, properties and method to control the state of async operations (IsBusy
,BusyMessage
, etc.). InheritsNotifyPropertyChanged
.
![ViewModelBase.png 1920](https://files.readme.io/daf526d-ViewModelBase.png)
ViewModelBase inheritance hierarchy diagram
CloseableViewModel
- inheritsViewModelBase
class, implementsIClosableViewModel
interface that allows to control the closing behaviour of ViewModel.
![CloseableViewModel.png 1920](https://files.readme.io/ac89da5-CloseableViewModel.png)
CloseableViewModel inheritance hierarchy diagram
ValidatableViewModel
- inheritsCloseableViewModel
class and contains methods and properties for validation. Also implementsINotifyDataErrorInfo
to notificate bindings about errors.
![ValidatableViewModel.png 1920](https://files.readme.io/7247974-ValidatableViewModel.png)
ValidatableViewModel inheritance hierarchy diagram
EditableViewModel
- inheritsValidatableViewModel
, allows to edit and validate models. This viewmodel is tracing the state of model object and allows to undo any changes.
![EditableViewModel.png 1920](https://files.readme.io/c3d96d9-EditableViewModel.png)
EditableViewModel inheritance hierarchy diagram
WorkspaceViewModel
- inheritsCloseableViewModel
class. Contains propertiesIsSelected
andDisplayName
. The first one allows to trace whenever VM was selected. The second one allows to show some useful text on the View through binding on any text property in View's control. ImplementsIViewAwareViewModel
interface that allows to work with View throughIView View
property. ImplementsINavigableViewModel
interface that allows to control navigation of ViewModel (through methodsOnNavigatingFrom
,OnNavigatedFrom
,OnNavigatedTo
).
![WorkspaceViewModel.png 1920](https://files.readme.io/d136537-WorkspaceViewModel.png)
WorkspaceViewModel inheritance hierarchy diagram
GridViewModel
- inheritsViewModelBase
, allows to work with different collections of objects through mechanism of bindings.
![GridViewModel.png 1920](https://files.readme.io/6965c23-GridViewModel.png)
GridViewModel inheritance hierarchy diagram
MultiViewModel
- inheritsCloseableViewModel
, allows to work with collection of viewmodels (especially useful for work withTabControl
).
![MultiViewModel.png 1920](https://files.readme.io/b62626f-MultiViewModel.png)
MultiViewModel inheritance hierarchy diagram
Updated less than a minute ago