OnNavigatedFrom() does not work but OnNavigatedTo() does on a INavigatedAware ViewModel

HelenMamalakiHelenMamalaki GBUniversity ✭✭

Given a Page A -> Page B -> Page C scenario.

The OnNavigatedTo() method fires for Page C but the OnNavigatedFrom() does not fire no matter what I do, I've tried suspending, closing, and navigating back using hardware back button and nav bar soft back button. Nothing.

I am not overriding the hardware back button or doing any code-behind navigation on Page C. I navigate from Page B Viewmodel like
await this.navigationService.NavigateAsync("Page C");

I am using Prism.Forms 7.0.0.396 and worried about how everything will break if I upgrade Prism only.
@BrianLagunas

Answers

  • stemadostemado Member ✭✭✭
    edited December 2018

    Can you upload your project?

  • HelenMamalakiHelenMamalaki GBUniversity ✭✭
    edited December 2018

    @stemado said:
    Can you upload your project?

    My code looks just like this guys: https://forums.xamarin.com/discussion/comment/319152

    I have now noticed that OnNavigatedFrom is only triggered by an Prism Navigation event e.g. this.navigationService.NavigateAsync("Page C") but surely navigating back, and suspending the app should also trigger it? I am interested in navigating back (both soft and hardware back button).

    I upgraded to the latest Prism.Forms 7.1.0.431 and Xamarin.Forms version: 3.4.0.1008975

Sign In or Register to comment.