android - Xamarin Shared Projects vs Portable class libraries -


i trying figure out better way go our project.

pcl library or shared project xamarin.

in xamarin documentation link here says rule of thumb choose shared project when not share library. shared project can written #if's make sure works multiple platforms - causes issues refactoring #ifs not active.

yet have gut feeling not right put code shared class. if code available windows, android , ios mobile platforms using shared project instead of pcl - means using #ifs inside shared project instead of writing platform specific code in platform specific project.

this trying make support of non pcl items via #ifs , making shared code more complex , harder maintain. shouldn't work done xamarin improving .net pcl codebase?

and means putting platform specific features in shared project , not platform specific project - i.e. hiding complexity specific platform platform project - feels wrong in terms of architecture.

am right (in case conflicting xamarin documentation) or missing something?

both have place. example put interface pcl, implementation of in shared code if implementation have decent amount of shared code.

i don't compiler flags either, prefer use partial classes. way can avoid majority, or all, of compiler flags. class1.cs go shared project , rest go platform specific projects.

class1.cs class1.ios.cs class1.android.cs class1.wp8.cs 

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -