From 713796a4f792a0eed66d6bac3a5abf2b371962cd Mon Sep 17 00:00:00 2001 From: Alistair Francis Date: Thu, 21 Dec 2017 05:55:24 -0800 Subject: [PATCH] UWP: Fix images when compiling with .NET Native Toolchain (#219) Following the instructions here: https://github.com/luberda-molinet/FFImageLoading/wiki/Xamarin.Forms-API#windows-uwp---compile-with-net-native-tool-chain-note fix the UWP App.xaml.cs to ensure images are loaded when building UWP apps for release. Signed-off-by: Alistair Francis --- src/UWP/App.xaml.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/UWP/App.xaml.cs b/src/UWP/App.xaml.cs index 980193e4e..395ae9579 100644 --- a/src/UWP/App.xaml.cs +++ b/src/UWP/App.xaml.cs @@ -9,6 +9,8 @@ using Plugin.Fingerprint; using Plugin.Settings.Abstractions; using SimpleInjector; using System; +using System.Collections.Generic; +using System.Reflection; using Windows.ApplicationModel; using Windows.ApplicationModel.Activation; using Windows.UI.Xaml; @@ -16,6 +18,7 @@ using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Navigation; using XLabs.Ioc; using XLabs.Ioc.SimpleInjectorContainer; +using FFImageLoading.Forms; namespace Bit.UWP { @@ -42,7 +45,13 @@ namespace Bit.UWP { rootFrame = new Frame(); rootFrame.NavigationFailed += OnNavigationFailed; - Xamarin.Forms.Forms.Init(e); + + var assembliesToInclude = new List() + { + typeof(CachedImage).GetTypeInfo().Assembly, + typeof(CachedImageRenderer).GetTypeInfo().Assembly + }; + Xamarin.Forms.Forms.Init(e, assembliesToInclude); ((Style)Resources["TabbedPageStyle"]).Setters[0] = ((Style)Resources["TabbedPageStyle2"]).Setters[0];