All my view models inherit ViewModelBase. When I close some views, I want to unregister the type, so that an uncached version is instantiated upon the next request. So in my ViewModelLocator I do a Cleanup when the view is closed for these applicable views:
public static void Cleanup(ViewModelBase vm)
This fails to unregister the applicable view model. Looking at the source, I see that the method uses
(which yields ViewModelBase) to unregister the class. If it were used
the correct view model class would be returned and that works.
PR submitted at