IConfirmNavigationAsync not being called from FlyoutPage view-model #2891
Unanswered
MartinRobins
asked this question in
Xamarin.Forms
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Prism.DryIoc.Forms 8.1.97
Xamarin.Forms 5.0.0.2578
Android 8.1 & 11
I have an XF application that uses a FlyoutPage (with a ContentPage for the Flyout and "other" pages for the detail.
The first page that is navigated to (following a login) is used as a menu page; navigated to as follows making it the new root of the application...
The view-model for MainMenuDetailPage supports IConfirmNavigationAsync...
class MainMenuDetailPageViewModel : ViewModelBase, IConfirmNavigationAsync
... the interface is implemented as follows...
... and the views/view-models are all registered correctly...
When I then touch the back button on the device, CanNavigateAsync is never called, but instead the application terminates (well, goes back to the Android home page).
If however I navigate forward from that page...
Then CanNavigateAsync is called.
Strangely, if I then apply the same IConfirmNavigationAsync to the view-model for the SelectCustomerGoodsInPage that I am navigating forward to above, pressing the same hardware back button calls CanNavigateAsync correctly.
I also have the following code in my Android MainActivity.cs which I picked up somewhere but no longer seem to be able to find where (and it no lnger seems to make any difference whether it is present or not)...
Is this me, or a limitation of the current PRISM implementation?
Beta Was this translation helpful? Give feedback.
All reactions