MvvmCross-AndroidSupport icon indicating copy to clipboard operation
MvvmCross-AndroidSupport copied to clipboard

Cached ViewModels (of fragments) don't re-run lifecycle when with a new navigation

Open vvolkgang opened this issue 9 years ago • 0 comments

Creating an issue so I don't forget to PR this. If a fragment ViewModel is cached and re-used,it won't re-run the lifecycle with a new navigation.

Problem source

My current solution was to change MvxFragment.OnCreate to also run the lifecycle for the cached one. Need to test this in the sample to figure if something more is required.

This might be related to #112

Steps to reproduce

Need to implement custom code in the sample to repro this.

Expected behavior

ViewModel should run his lifecycle again, receiving the new navigation parameters and updating the view with new info

Actual behavior

Given that the ViewModel is cached and didn't ran the navigation, the view will have the previous info.

Configuration

Version: 4.0.0

vvolkgang avatar Mar 15 '16 11:03 vvolkgang