Skip to content

Latest commit

 

History

History
30 lines (18 loc) · 852 Bytes

README.md

File metadata and controls

30 lines (18 loc) · 852 Bytes

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