We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to resolve Image is not appearing in Release mode in SfImageEditor XForms.UWP?

Platform: Xamarin.Forms |
Control: SfImageEditor |
Published Date: June 25, 2018 |
Last Revised Date: June 25, 2019

Xamarin does not load the renderer assemblies by default in Xamarin.Forms.UWP project in Release mode. So, In order to solve this, You have to manually load it by creating instance of Renderer class in App.cs file.

Step 1: Create an instance of SfImageEditorRenderer in App.cs file. Use the below code snippet.

 

protected override void OnLaunched(LaunchActivatedEventArgs e)
{
    List<Assembly> assembliesToInclude = new List<Assembly>();
    assembliesToInclude.Add(typeof(Syncfusion.SfImageEditor.XForms.UWP.SfImageEditorRenderer).GetTypeInfo().Assembly);
    Xamarin.Forms.Forms.Init(e, assembliesToInclude);
}

 

Step 2: To support displaying embedded images in release mode on forms Universal Windows Platform, it’s necessary to use the overload of ImageSource.FromResource that specifies the source assembly in which to search for the image.

Code Snippet:

public MainPage()
{
    InitializeComponent();
    imageeditor.Source = ImageSource.FromResource([Namespace.Imagename.Imagetype],typeof(App).GetTypeInfo().Assembly);
}                                                     

 

Example:

 

imageeditor.Source = ImageSource.FromResource("Filename.png",typeof(MyClass).GetTypeInfo().Assembly);                                                                                                    

 

2X faster development

The ultimate Xamarin UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon