Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 89864

Is it possible to use Xamarin.Forms and Xamarin native (Xamarin.Android, Xamarin.IOS)?

$
0
0

Greetings everyone!
I hope I'm not the only one who has come across the need to use Xamarin.Forms and Xamarin native in the same solution.

Firstly, I started out down the Xamarin Native path, and converted the projects over to use XF. So far so good. Loving the XF path!

One of the required features I have working nicely in the native path is the Onboarding pages. For android I used ViewPager and Fragments, IOS I used a UIPageIndicator and ViewControllers....etc, etc.

I was able to reuse all of the Onboarding code for the XF.Android project, but am having a bit of difficulty getting it working in the XF.IOS project.
With the XF.Android project, if it's the user's first time using the app, I start the OnboardingActivity, otherwise, I start the MainActivity, which then invokes the XF.Init() along with LoadApplication(new App()), and the XF initialization process takes over and works as expected. I believe this was easier because I have control over when I can kill (or Finish) the current activity before starting a new one.

However, with IOS, I only have the AppDelegate to invoke the XF plumbing (Forms.Init() & LoadApplication). So at the end of the Onboarding process, the user clicks "Let's get started", and I tried invoking the XF plumbing by making the AppDelegate a singleton, thereby invoking LoadApplication from the last step of the Onboarding process. No errors occurred, but the screen didn't change over to the XF MainPage, which is what I expected.

Is it even possible? Is there an easier way?
How can I kill (or exchange) the current UINavigationController for the one that will get loaded via the LoadApplication(new App())?

Any pointers will be greatly appreciated.
thanks much!


Viewing all articles
Browse latest Browse all 89864

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>