New to Telerik UI for Xamarin? Download free 30-day trial

ComboBox border is not visible in release build (UWP)

Environment

Product Version 2021.3.915.1
Product ComboBox for Xamarin

Description

The article will show you how to visualize the Border that wrapps around the ComboBox control. When the app is built for UWP in Release Mode the border is not visible. The reason behind this is that the .NET Native Toolchain strips the assemblies needed for visualizing the RadBorder control.

In addition the drop-down button and clear button look different.

Solution

Make sure that the Telerik renderers are not stripped out by the UWP .NETNative compilation step. Add the following code inside the App.xaml.cs file of the UWP Project:

var assembliesToInclude = new List<Assembly>()
{
    typeof(Telerik.XamarinForms.Input.RadButton).GetTypeInfo().Assembly,
    typeof(Telerik.XamarinForms.InputRenderer.UWP.ButtonRenderer).GetTypeInfo().Assembly,
    typeof(Telerik.XamarinForms.Primitives.RadBorder).GetTypeInfo().Assembly,
    typeof(Telerik.XamarinForms.PrimitivesRenderer.UWP.BorderRenderer).GetTypeInfo().Assembly,
};
Xamarin.Forms.Forms.Init(e, assembliesToInclude);
In this article