xamarin/Xamarin.Forms

[Bug] Shell - OnAppearing not executing

Aberta

#6.486 aberto em 11 de jun. de 2019

 (44 comentários) (10 reações) (0 responsável)C# (1.926 forks)batch import
a/shell :shell:e/2 :clock2:help wantedm/high impact :black_large_square:p/1t/bug :bug:up-for-grabs

Métricas do repositório

Stars
 (5.644 estrelas)
Métricas de merge de PR
 (Métricas PR pendentes)

Description

Description

I have overrided the OnAppearing (and OnDisappearing) methods in the AppShell of a new project. The OnAppearing never seems to execute. Shell inherits from Page, so it should probably use OnAppearing. This would be nice for executing code that needs to be await'ed and cannot be in the constructor.

Steps to Reproduce

  1. Create a new Xamarin Forms Project and select the Shell template
  2. Open AppShell.xaml.cs
  3. Add an override for OnAppearing
  4. Add code in the OnAppearing to write to the Console
  5. Set breakpoint
  6. Run the project

Expected Behavior

The breakpoint should be hit or at least the Console WriteLine should be visible in the output window.

Actual Behavior

The breakpoint is never hit and the text does not show up in the output window.

Basic Information

  • Version with issue: 4.0.0.482894
  • Last known good version: N/A
  • IDE: Visual Studio 2019 for Windows 16.1.2
  • Platform Target Frameworks:
    • iOS: 12.10.0.153
    • Android: N/A
    • UWP: N/A
  • Android Support Library Version: N/A
  • Nuget Packages: Just what comes with the template
  • Affected Devices:

Screenshots

Reproduction Link

https://github.com/seansparkman/ShellNavigationExample/blob/master/ShellNavigationRegistration/ShellNavigationRegistration/AppShell.xaml.cs#L27

Also resolve the issue with OnNavigated not firing https://github.com/xamarin/xamarin.forms/issues/6486#issuecomment-540595443

Guia do colaborador