PrismLibrary / Prism

Prism is a framework for building loosely coupled, maintainable, and testable XAML applications in WPF, Xamarin Forms, and Uno / Win UI Applications..

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] BindingContext cleared when performing absolute navigation

renduNP opened this issue · comments

Description

Our Developers have observed an issue that affects Android while using absolute navigation.
E.g. When performing absolute navigation from PageA to a TabbedPage, it appears that PageA's BindingContext is cleared before PageA is removed from UI and the navigation completes.
This results in any controls that are bound to PageA's BindingContext will reset/update causing the UI of PageA to appear incorrectly until the navigation completes. It also appears that the complexity of the tabs being navigated to will affect the time taken for navigation to complete, which can cause PageA to remain visible for several seconds with incorrect UI.

We have observed this issue on version 9.0.436-pre, we are unaware of a version where this issue does not occur.

Steps to Reproduce

See Sample app to reproduce the issue here -
PrismMauiApp2.zip

Platform with bug

.NET MAUI

Affected platforms

Android

Did you find any workaround?

No response

Relevant log output

No response

@renduNP is this issue specific to Android? Prism shouldn't have any platform specific behaviors here.

@dansiegel I work with @renduNP and assisted in the investigation on this issue.
We have not been able to reproduce this issue on iOS but we're not exactly sure why.

The best example we were able to recreate in the reproduction sample was when navigating absolutely from the ModalPage. There is a button labeled "Hidden button" that is hidden due to it's IsVisible property being bound to the ImageVisable property in the associated ViewModel. When navigating away, we think the BindingContext is cleared too soon and the "Hidden button" becomes visible. This isn't something we've observed on iOS.
We're happy to help investigate however possible, please let us know how we can help.