Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Enhancement] Embedding XF-Open Xamarin Forms "Page" from Xamarin.Android #8153

Closed
saamerm opened this issue Oct 22, 2019 · 2 comments
Closed

Comments

@saamerm
Copy link

saamerm commented Oct 22, 2019

Summary

As you can see in the current Xamarin PageExtensions available for Android and iOS, Xamarin allows you to convert any type of Xamarin.Forms(XF) Page to a native ViewController in iOS, but it only allows converting a XF ContentPage to a native Fragment in Android.

The XF Page plays a major role when you are trying to implement an XF NavigationPage or TabbedPage allowing for a dashboard with tabs and subsequently being able to navigate between pages without having to go back into native code. So, currently I can handover complete control to XF on iOS, but on Android I can only use XF to display a single ContentPage with no control over navigation.

My request is to extend the API to allow opening an XF Page from Xamarin.Android, rather than just a ContentPage.

API Changes

This would require creating an overridden constructor in the Xamarin.Forms.Platform.Android /AppCompat/PageExtensions.cs file referenced above that would take a Page and instead of a ContentPage. I am not sure of the other changes this would require to make this happen in the Xamarin.Forms.Platform.Android project.

Intended Use Case

This would be great for teams trying to use XF Embedding to convert projects from using Xamarin.Native to XF, for easier maintenance & implementation of features.

Added Explanation: You can open NavigationPages on iOS, as you can see in this sample here which allows using functions like PushAsync or PopAsync, by simply doing:

UIViewController user2 = new NavigationPage(new TestPage()).CreateViewController();

So for Android as seen here, currently we can only do this: ✅

Android.Support.V4.App.Fragment fragment = new TestPage().CreateSupportFragment(this);

and we need to create a way to do something like this: ❌

Android.Support.V4.App.Fragment fragment = new NavigationPage(new TestPage()).CreateSupportFragment(this);

PS: Here's a sample Github that contains a playground created as a Spike. If someone knows of a work around, please let me know.

@pauldipietro pauldipietro added this to New in Triage Oct 22, 2019
@hartez hartez removed this from New in Triage Oct 22, 2019
@samhouts samhouts added this to Under consideration in Enhancements Oct 28, 2019
@jfversluis
Copy link
Member

Thanks for this suggestion! As Xamarin.Forms is now in maintenance mode, this will not happen anymore for Xamarin.Forms. We're only adding bugfixes and stability fixes.

If this is still important to you, make sure to check the .NET MAUI repo and see if it's already on the roadmap. If not, feel free to open a discussion to discuss a change first or open an issue with a detailed feature request. Thanks!

@jfversluis jfversluis closed this as not planned Won't fix, can't repro, duplicate, stale Aug 23, 2022
Enhancements automation moved this from Under consideration to Closed Aug 23, 2022
@saamerm
Copy link
Author

saamerm commented Aug 23, 2022

@jfversluis thank you! I added it as a request dotnet/maui#9606

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Enhancements
  
Closed
Development

No branches or pull requests

2 participants