You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 27, 2020. It is now read-only.
Due to some reason I don't want to keep the same instance of my view model through out the life time of the app. That is the reason I am using Scope as new Instance.
But now I noticed that the View Model that are created while navigation are not disposing at all. The events that I registered are firing for multiple times, based on the number of times I navigated to the page.
This is creating lot of issues in my application. Could you please let me know the best method to dispose this view models when the user navigates back (INavigationService.GoBack) method.
The text was updated successfully, but these errors were encountered:
I've found this to be a problem a times generally speaking where the View having a BindingContext of the ViewModel causes the View/ViewModel combo to leak. When the view is "done" try setting the BindingContext to null. This seems to break anything tied through bindings and allow the cleanup.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
@markjulmar : Could you please help me on below issue.
In my app I am using DependencyServiceExtension in the library to create my ViewModel. For example
Due to some reason I don't want to keep the same instance of my view model through out the life time of the app. That is the reason I am using Scope as new Instance.
But now I noticed that the View Model that are created while navigation are not disposing at all. The events that I registered are firing for multiple times, based on the number of times I navigated to the page.
This is creating lot of issues in my application. Could you please let me know the best method to dispose this view models when the user navigates back (INavigationService.GoBack) method.
The text was updated successfully, but these errors were encountered: