Edit: This question is a bit out of date now that Google has given us the ability to scope ViewModel
to navigation graphs. The better approach (rather
As I know you can't remove ViewModel object manually by program, but you can clear data that stored in that,for this case you should call Oncleared()
method manually
for doing this:
Oncleared()
method in that class that is extended from ViewModel
class