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. It is now read-only.
Create an app with only one VM and a fragment to display it (suppose the VM has one property ID)
From the fragment, create a Command to navigate to the same VM but with a different "criteria" (imagine navigating to a same object but with a different ID)
Follow the navigation:
Launch the app
Display the VM with ID 1
From this fragment, click on the button to navigate to the VM with ID 2
Press the back button
Press the button to navigate to the VM with ID 2
Expected behavior
The fragment with ViewModel ID 2 should be displayed
Actual behavior
Nothing happens
Origin of the issue
The ShouldReplaceCurrentFragment returns FragmentReplaceMode.NoReplace.
This is because when navigating to VM with ID 2, ShowFragment set the fragInfo.CachedFragment with informations about VM with ID 2. When we click on the back button, we so display back the VM with ID 1.
Then if we click again on the button to display VM with ID 2, the fragment's tag to display is the same as the one currently displayed but with informations from VM ID 2 (pressing the back button didn't update CachedFragment object in "currentFragInfo").
Keep it simple, issue is the cached Fragment is not updated on BackButton pressed if going back to a fragment with the same tag.