Class
RadPath

Represents a simple path defined by its Geometry.

Definition

Namespace:Telerik.Maui.Controls

Assembly:Telerik.Maui.Controls.dll

Syntax:

cs-api-definition
public class RadPath : RadLayout

Inheritance: objectRadLayoutRadPath

Inherited Members RadLayout.CreateLayoutManager()

Constructors

RadPath()

Initializes a new instance of the path.

Declaration

cs-api-definition
public RadPath()

Fields

FillProperty

Identifies the Fill property.

Declaration

cs-api-definition
public static readonly BindableProperty FillProperty

Field Value

BindableProperty

GeometryProperty

Identifies the Geometry property.

Declaration

cs-api-definition
public static readonly BindableProperty GeometryProperty

Field Value

BindableProperty

StrokeProperty

Identifies the Stroke property.

Declaration

cs-api-definition
public static readonly BindableProperty StrokeProperty

Field Value

BindableProperty

StrokeThicknessProperty

Identifies the StrokeThickness property.

Declaration

cs-api-definition
public static readonly BindableProperty StrokeThicknessProperty

Field Value

BindableProperty

Properties

Fill

Gets or sets the fill of the path.

Declaration

cs-api-definition
[TypeConverter(typeof(RadBrushTypeConverter))]
public RadBrush Fill { get; set; }

Property Value

RadBrush

Geometry

Gets or sets the path geometry.

Declaration

cs-api-definition
[TypeConverter(typeof(GeometryTypeConverter))]
public RadPathGeometry Geometry { get; set; }

Property Value

RadPathGeometry

Example

csharp
// Create a simple square path geometry
var path = new RadPath
{
    Geometry = new RadPathGeometry
    {
        Figures = new List<RadPathFigure>
        {
            new RadPathFigure
            {
                StartPoint = new Point(0, 0),
                Segments = new List<RadPathSegment>
                {
                    new RadLineSegment { Point = new Point(1, 0) },
                    new RadLineSegment { Point = new Point(1, 1) },
                    new RadLineSegment { Point = new Point(0, 1) },
                    new RadLineSegment { Point = new Point(0, 0) }
                }
            }
        }
    },
    Fill = new RadSolidColorBrush(Colors.Blue),
    Stroke = new RadSolidColorBrush(Colors.Black),
    StrokeThickness = 2
};

// Create a star
var path = new RadPath
{
    Geometry = RadGeometry.Star,
    Fill = new RadSolidColorBrush(Colors.Blue),
    Stroke = new RadSolidColorBrush(Colors.Black),
    StrokeThickness = 2
};

// Create a circle
var path = new RadPath
{
    Geometry = RadGeometry.Circle,
    Fill = new RadSolidColorBrush(Colors.Red),
    Stroke = new RadSolidColorBrush(Colors.Black),
    StrokeThickness = 2
};

// Create a heart
var path = new RadPath
{
    Geometry = RadGeometry.Heart,
    Fill = new RadSolidColorBrush(Colors.Pink),
    Stroke = new RadSolidColorBrush(Colors.Red),
    StrokeThickness = 2
};

// Create a diamond
var path = new RadPath
{
    Geometry = RadGeometry.Diamond,
    Fill = new RadSolidColorBrush(Colors.Yellow),
    Stroke = new RadSolidColorBrush(Colors.Orange),
    StrokeThickness = 2
};

Stroke

Gets or sets the stroke of the path.

Declaration

cs-api-definition
[TypeConverter(typeof(RadBrushTypeConverter))]
public RadBrush Stroke { get; set; }

Property Value

RadBrush

StrokeThickness

Gets or sets the stroke thickness.

Declaration

cs-api-definition
public double StrokeThickness { get; set; }

Property Value

double