-
Notifications
You must be signed in to change notification settings - Fork 51
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
Support for MAUI Embedding #60
Comments
On Android anyway, (iOS probably similar),
Apparently Alerts in MAUI have the same issue, so it's probably going to be a race to see who takes on the solution first. |
I have made some changes to make Mopups work with Maui Embedded. So far so good... The main change I made was to check if the PopupPage.Parent is null or not before setting it to the MauiApplication.Current..Windows[0].Content To make it work with Maui Embedded when you create your popup page:
I also fixed couple issues on iOS, I'm not sure if these were a result of using Maui Embedded or not but,
|
Does it could solve the issue that when showing (for example) a loading popup before a navigation page "PushAsync" the popup stays in the backgroud ? |
Nope. It looks like if you use Maui Embedded anything relating to navigation, like pushing/popping views and events like Appearing/Disappearing either don't work properly or not at all. To fix those issues, you will have to implement it yourself, using MaterialAlertDialogBuilder on android or UIAlertController on iOS. |
Just clocking in noticed your work, i should make another release with this in the mix |
SUMMARY
Hi! Thank you very much for your work in porting this library to .NET MAUI, it is greatly appreciated!
We have an app that utilizes MAUI Embedding to use MAUI pages in ".NET for Android" and ".NET for iOS" apps (previously Xamarin.Android and Xamarin.iOS). I was hoping to use your library in this app, but it seems that the Mopups registration doesn't seem to take effect when using this approach. Do you know if this is possible at all with this approach, or if this is something that's possible to implement? When I try to open a popup page from the iOS project, I get this error at runtime:
System.NullReferenceException: Object reference not set to an instance of an object. at Mopups.iOS.Implementation.iOSMopups.AddAsync(PopupPage page) at Mopups.Services.PopupNavigation.<>c__DisplayClass20_0.<<PushAsync>g__PushPage|0>d.MoveNext()
On Android I just get a NullReferenceException at runtime.
DETAILS
The use-case involves having one class library for the iOS/Android app and one class library where the MAUI pages are located. I use the embedding technique (as described in the previous link) and I use the host builder to add the .ConfigureMopups() in my AppDelegate.cs / MainActivity.cs. I've attached a repro of a project that uses MAUI embedding and that tries to use this package.
I understand that this embedding technique might not be all that used, but it would be great if there is a way to make this package work with this setup.
PLATFORMS
MAUIEmbedding.zip
The text was updated successfully, but these errors were encountered: