Further VM base classes with activation logic #213
VacuumBreather
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
There are many MVVM toolkits and frameworks out there but few implement activation and deactivation in view model base classes.
In the recent past I've tried to port Caliburn.Micro to a different platform and in the process tried to improve some of the async API, fix some nullable problems and decouple it as a separate unit from some of the remaining Caliburn features.
I was thinking about cleaning this up further, basing them on the toolkit's ObservableObject and making a pull request, but I first wanted to check if the team thinks that there is room in the toolkit for something like this?
Maybe in Mvvm.ViewModels or Mvvm.ScreensAndConductors or something like that.
For anybody unfamiliar with Caliburn.Micro, it basically provides Screens and ScreenConductors which have activation and deactivation logic, closing sanity checks and such. The conductor classes can keep one or multiple active subscreens which they keep in an activation state reflecting their own, which works hierarchical all the way to the main view model.
I think initialization, activation and deactivation logic is very common, so having base classes which provide the necessary base implementation on virtual methods to override would benefit people who want something like this but wouldn't want an entire framework to come along with it. Also Caliburn's current implementation still has some nullability and async API issues that will probably take another version to completely iron out.
What's your opinion on this? Is this something that has a place in the toolkit?
Edit: Not done yet but this is basically the idea:
https://github.com/VacuumBreather/VacuumBreather.Mvvm
Beta Was this translation helpful? Give feedback.
All reactions