Key Features

The purpose of this help article is to show you the key features of the RadBorder control.

Define RadBorder

Add RadBorder definition in XAML:

<telerikMauiControls:RadBorder BorderColor="Red" BorderThickness="1">
    <Label Text="Hello there" Margin="2" />

Add the following namespace:


Border Color

You can use the BorderColor property to specify the color of RadBorder. The property has no effect if BorderThickness is set to “0”.

Border Thickness

The BorderThickness property is of type Microsoft.Maui.Thickness and is used to set the borders’ width. Type Thickness gives you the option to define different border on each side of the surrounded element.

Here is a quick example on how to use BorderColor and BorderThickness properties:

<telerikMauiControls:RadBorder BorderColor="#4488F6" BorderThickness="1, 2, 1, 2">
    <Label Text="Hello there" Margin="2" />

Different Corners

The CornerRadius property represents the degree to which the corners of the Border are rounded. CornerRadius is of type Microsoft.Maui.Thickness so it allows you to set separate values on the four corners of the border.

<telerikMauiControls:RadBorder BorderColor="#4488F6" 
                               CornerRadius="15, 5, 15, 5">
    <Label Text="Hello there" Margin="2" />

Additionally, the wrapped content will be clipped according to each side’s specified corner radius. The next example shows how you could have circle image by wrapping Image control with RadBorder.

<telerikMauiControls:RadBorder CornerRadius="25" 
    <Image Source="XamarinIcon.png" 
           HeightRequest="50" />

Here is the end result:

Telerik Border for .NET MAUI

Border Key Features Example

See Also

In this article
Not finding the help you need?