Xamarin Forms Customer Control Library

121 Views Asked by At

I need to create a reusable Xamarin Forms control that will be used in two separate projects. It does require custom renderers for IOS and Android. The problem is I cannot figure our what kind of project to use to create a reusable custom control library for Xamarin forms.

Every site seems to talk about creating customer controls that can be reusing in the same project. But I need it in a separate project for reuse.

Can someone please point me in the right direction.

1

There are 1 best solutions below

3
On

Depending what are your needs regarding multi-targeting, using a solution with a shared project of type MSBuild.Sdk.Extras could be very helpful. You can then packed your shared project into a package that you can reference from your apps project and use locally.

Examples that might guide you and shows you the path are known nuget packages that are being used by app developers cross-platforms, just an example Xamarin.Forms.PancakeView.

Related to MSBuild.Sdk.Extras: How to use different base class in custom control depending on platform target?