Forum Cross Platform with Xamarin


The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

Control library - cross platform or not?


I have been working on a mobile app for some time now using Xamarin forms for ios and Android. I have created a number of custom controls which have custom renderers in each specific platform project. I have a shared library containing all the Xamarin forms stuff and business logic and then my ios and Android projects which have the specific platform stuff - all works great.

I've now started work on another app and I'd like to use the same controls in it but I obviously don't want to have to copy all that code in, I want to create a shared library. I've done some research on this and I've tried almost every combination of New project in Dev Studio (I'm working on a Mac) and I can't seem to fathom how to go about this. Should I be creating a PCL/.Net standard/Xamarin Forms library, how many libraries should I create, etc, etc. I've been reading that PCLs are now defunct and should be replaced by .NET standard but I don't understand Microsoft's parlance when it comes to describing what it does or how it replaces PCLs.

Does anyone have any good documentation on how to do this? I tried creating a Multiplatform library which had a shared project, an IOS and an Android project in it but when I added one of my controls and built it, it built fine and produced a dll but importing that dll into my app showed no signs of my classes available as imports. Building a simple class library does work but that doesn't include API specific code in it.

Bit stuck...



Sign In or Register to comment.