Skip to content

felipebaltazar/Xamarin.Forms.EmbeddedAssets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Xamarin.Forms.EmbeddedAssets

Free yourself from platform specifc assets

Getting started

  • Include your assets as embedded resource on your NetStandard project

  • Declare all assets that you need to use

using Xamarin.Forms.EmbeddedAssets;
using Xamarin.Forms.Xaml;

[assembly: XamlCompilation(XamlCompilationOptions.Compile)]

[assembly: ExportAsset("MyPage.html", loadAssociatedResourcesInFolder: true)] //here you can declare your assets files and if some associated files (in the same folder) are needed
  • Now you can use the default markup extension
<WebView Source="{EmbeddedAsset MyPage.html}"
                 VerticalOptions="FillAndExpand"
                 HorizontalOptions="FillAndExpand"/>

image