We have implemented the framework Prism/Unity in our application.
We register the view and the viewmodel with register.type and we pass in parameter ContainerControlledLifetimeManager.
We only have one instance for each view and view model in the application.
We would like to unregister the view and the view model each time we recall the view but we still with the same instance, means, no reload of the data context and the view model.
Here is what we have tried to recreate a new one:
- Remove the weak reference
- Teardown the view in the region
- Dispose the datacontext in the view
- Teardown the View
The result of these actions, everything works but we never pass again in the constructor of the view model, it's still instantiated.
How can we unregister the link between the view and the view model to recreate a new one?
If you want some parts of code, let us know.
Thank you for your help.
PS: we made an issue on the Unity Issue Tracker but we have been told to post on the Prism forums...