Free yourself from platform specifc assets
-
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"/>