OnAppearing does not get executed in Shell in Xamarin.forms

Seun Tope 21 Reputation points
2022-03-17T09:48:11.047+00:00

OnAppearing method does not get executed

public partial class AppShell : Shell
    {
 public AppShell()
        {
            InitializeComponent();
        }


        protected override void OnAppearing()
        {
            base.OnAppearing();
//some logic
        }
Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,347 questions
0 comments No comments
{count} votes

Accepted answer
  1. Leon Lu (Shanghai Wicresoft Co,.Ltd.) 75,121 Reputation points Microsoft Vendor
    2022-03-18T02:23:53.123+00:00

    Hello,​

    I create a shell project, I get the same issue as yours. And I find this issue is reported in the Github: Shell - OnAppearing not executing #6486. Please waiting for update in the GitHub Page. If Product Group fix this issue.

    Do you have <ShellContent> in your AppShell.xaml? If so, you can use Appearing="ShellContent_Appearing" method in the <ShellContent>. Then move your OnAppearing method from Shell to <ShellContent>' Appearing event.

    Best Regards,

    Leon Lu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.