Creating a cross platform library with optional Xamarin.Forms support.

NigelSampsonNigelSampson NZMember

Hi all,

I'm in the process of porting an open source project that currently supports most of the existing xaml framesworks.

  • WPF,
  • Silverlight
  • Windows Phone (Silverlight & WinRT)
  • Windows 8)

I'd like to add Xamarin to this list and am looking for some advice on the best way to structure the new Xamarin assemblies to achieve the goals below.


  • Support Xamarin.Android and Xamarin.iOS with a potential subset of functionality.
  • Extra functionality when Xamarin.Forms is being used.
  • Don't force the developer into Xamarin.Forms.

Current approach

At present the solution is structured with a portable class library and a platform specific library for each supported platform. This works well with no major problems.

The portable library has been extended to use Xamarin with problems and I've created two platform specific assemblies for Android and iOS which appear to be working correctly.

My major concern here is that if these two platform specific assemblies take a dependency upon Xamarin.Forms then I force the developer onto that path even if they don't use any of that functionality in their application. I'd also like to avoid creating four assemblies, one for each platform with and without Xamarin.Forms.

I guess part of this question could depend on licensing, but would love hear peoples thoughts on how to approach this.



Sign In or Register to comment.