Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Native embedding: OnAppearing override not invoked #11281

Open
davidbritch opened this issue Nov 11, 2022 · 5 comments
Open

Native embedding: OnAppearing override not invoked #11281

davidbritch opened this issue Nov 11, 2022 · 5 comments
Labels
area-core-lifecycle XPlat and Native UIApplicationDelegate/Activity/Window lifecycle events i/great-reporter This issue is opened by an author who is known to open high-quality issues s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working t/native-embedding
Milestone

Comments

@davidbritch
Copy link
Contributor

davidbritch commented Nov 11, 2022

Description

I've been playing around with native embedding. In native apps on Android, iOS, and Windows, the ContentPage.OnAppearing override isn't being invoked on navigation, whereas it is in .NET MAUI apps. This makes it more difficult to load data on page load, which many people tend to do in OnAppearing.

This behaviour is identical in .NET 6 and 7, so I suspect it's more an omission than a regression.

Steps to Reproduce

  1. Pick a platform. I'd recommend Android or Windows, because when the app launches on iOS it takes a while a breakpoint at the start of FinishedLaunching to even be hit.
  2. Put in a breakpoint in NotesPage.OnAppearing.
  3. Run sample.

The breakpoint is never hit.

Link to public reproduction project repository

https://github.com/davidbritch/dotnet-maui-issues/tree/main/Embedding

Version with bug

.NET 7 GA (also occurs in .NET 6)

Last version that worked well

Don't think it's ever worked.

Affected platforms

iOS, Android, Windows

@davidbritch davidbritch added the t/bug Something isn't working label Nov 11, 2022
@ghost ghost added the i/great-reporter This issue is opened by an author who is known to open high-quality issues label Nov 11, 2022
@PureWeen PureWeen added the area-core-lifecycle XPlat and Native UIApplicationDelegate/Activity/Window lifecycle events label Nov 11, 2022
@PureWeen PureWeen added this to the Backlog milestone Nov 11, 2022
@ghost
Copy link

ghost commented Nov 11, 2022

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@Zhanglirong-Winnie Zhanglirong-Winnie added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Oct 23, 2023
@Zhanglirong-Winnie
Copy link

Verified this issue with Visual Studio Enterprise 17.8.0 Preview 3.0. Can repro on android platform with sample project.
https://github.com/davidbritch/dotnet-maui-issues/tree/main/Embedding

@nau-dwb
Copy link

nau-dwb commented Jan 11, 2024

Note the Page.Appearing and Page.Disappearing events also do not fire when using MAUI embedded.

We're trying to migrate our mission critical mobile application from Xamarin Android\iOS with embedded Xamarin Forms to .NET 7 Android\iOS using embedded MAUI and the embedded use case appears to be severely broken. This is but one of many issues we've encountered.

Being able to hook into when the page appears and disappears is a pretty common use case. This has been open since 2022 - can we please get some priority placed on resolving this? Not sure if any of the work proposed under Issue 1718 would get this closer to resolved?

I also have sample repro code in the 'simple-maui-embedded' solution from https://github.com/nau-dwb/maui-embedded-use-issues/tree/main

@follesoe
Copy link

follesoe commented Apr 3, 2024

Issues like these are hindering migration for several larger Xamarin apps to MAUI. We have an app making extensive use of Xamarin.Forms embedding.

@PureWeen
Copy link
Member

Unfortunately, we didn't properly take into account multi-window with embedding so there are a few paths that don't light up with embedding.

I've modified the sample here to light up "appearing" and "disappearing"

PureWeen/maui-embedded-use-issues@dd8a660

In XF we just wired appearing/disappearing to platform hooks so that's really what this work comes down to.

If for some reason the code I have setting up a window doesn't work for you, then I'd just recommend calling through to your own methods on the ContentPage that fire at the same points in time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-lifecycle XPlat and Native UIApplicationDelegate/Activity/Window lifecycle events i/great-reporter This issue is opened by an author who is known to open high-quality issues s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working t/native-embedding
Projects
None yet
Development

No branches or pull requests

6 participants