We have upgraded our Xamarin Forms iOS/Android projects + core, from MvvmCross 6.3.1 to 7.1.2 and we are running into an issue.
We have 4 ViewModels -
A B C D
and I have navigated from A to B, then from B to C, then from C to D -
A -> B -> C -> D
The B, C, and D Views have the standard attribute -
[MvxContentPagePresentation(WrapInNavigationPage = true)]
In the D view I tap on a 'Done' button and to go back to B we use -
var presentationHint = new MvxPopRecursivePresentationHint(levelsDeep: 2);
await NavigationService.ChangePresentation(presentationHint);
This used to work in 6.3.1, but with 7.1.2, when it navigates back to B, the screen is blank, the XAML is not rendered. It does navigate back to B, we put a breakpoint in B's ViewAppeared.
What is strange is that when it navigates back to B, we can tap on the blank screen where a button would be to navigate to C, and it navigates to C. Then if we tap back (Android back button in the top, not on the bottom/device), it does navigate back to B and also the View is properly displayed, the XAML is rendered.
Furthermore, this does not always happen - sometime on navigating back to B it does render the B View properly. We have reproduced the issue on Android, both in release on the metal and in debug on an Android emulator. On iOS it always works.
The same issue happens with -
await NavigationService.ChangePresentation(new MvxPopPresentationHint(typeof(B)));
This does work and navigates back to A and renders the A View -
var presentationHint = new MvxPopToRootPresentationHint();
await NavigationService.ChangePresentation(presentationHint);
But sometimes we need to navigate back to B or C and not all the way back to the root A.
In https://www.mvvmcross.com/mvvmcross-7.1.0-release/ I do see "This is minor version primarily with bugfixes and clean up of code around the Android and iOS presenter code." - but I have not found any specific steps on what we would need to do once we upgrade to 7.1.2 if we ran into the issue above.
It's hard to provide a sample project, so before spending the time to do so, I was wondering if someone had an idea of what the issue might be.
Has something changed from 6.3.1 to 7.1.2 that would require us to change how we navigate back from D to B using MvxPopRecursivePresentationHint(levelsDeep: 2) so the B View is rendered?
This could also not have anything to with MvvmCross but some issue with our Android project as we upgraded to AndroidX still on Xamarin Forms 4.8 - does anyone have any tips or workarounds to suggest?