Repository navigation
Mvvm Framework
kobi2294 edited this page Apr 23, 2019
·
9 revisions
The Mvvm Kit is a strongly opinionated framework the helps to build advanced WPF applications.
To create an MvvmKit application, do the following:
- Create a new project using the
Mvvm Kit Project Templatefor visual studio - Create Components using the
Mvvm Kit Component Templatefor visual studio - The view model is inherited from
ComponentBase, add bindable properties and delegate commands to it. - Each Component comes with a resource dictionary for design time data, add design time instances of your view model
- Draw the view using the Design Time Data.
- Creates Model services by inheriting from
ServiceBase - Add the services to the Unity container in the Bootstrapper.
- Consume the services in the view models by declaring them in the
InjectMethod. - Expose service state changes using
AsyncEvent - Define global regions in the application using the GlobalRegions static class
- Define region hosts in the container view by using the GlobalHost attached properties
- If the region has a small constant set of possible views, you can define a router for that region and use it for navigation. Otherwise, you can perform navigations directly on the region using the region manager.
- You can define Dialog Components by inheriting the view model from
DialogBaseinstead ofComponentBase. - You can run the dialogs and collect the results using the regions manager and a dedicated dialogs host.