Date post: | 09-Jan-2017 |
Category: |
Software |
Upload: | hernan-zaldivar |
View: | 136 times |
Download: | 0 times |
XamarinShared Asset Projects
vsPortable Class Library
XamarinShared Asset ProjectsUse a single set of files and offers a quick and simple way in which to share code within a solution and generally employs conditional compilation directives to specify code paths for various platforms that will use it
XamarinShared Asset ProjectsBenefits : ● Allows you to share code across multiple projects.● Shared code can be branched based on the platform using compiler
directives (eg. using #if __ANDROID__ , _IOS__ , __WINDOWS_PHONE__)
● Application projects can include platform-specific references that the shared code can utilize (such as using Community.CsharpSqlite.WP7 in the Tasky sample for Windows Phone).
XamarinShared Asset ProjectsDisadvantages:● Unlike most other project types, a Shared Project has no 'output'
assembly. During compilation, the files are treated as part of the referencing project and compiled into that DLL. If you wish to share your code as a DLL then Portable Class Libraries are a better solution.
● Refactorings that affect code inside 'inactive' compiler directives will not update the code.
XamarinShared Asset Projects
Shared Asset Projects
XamarinPortable Class LibrariesProjects target specific profiles that support a known set of BCL classes/features. However, the down side to PCL is that they often require extra architectural effort to separate profile specific code into their own libraries
XamarinPortable Class LibrariesBenefits:● Allows you to share code across multiple
projects.● Refactoring operations always update all
affected references.
XamarinPortable Class LibrariesDisadvantages:● Cannot use compiler directives.● Only a subset of the .NET framework is
available to use, determined by the profile selected.
XamarinPortable Class Libraries
XamarinVeamos un pequeño ejemplo!
XamarinMuchas Gracias