Table of Contents

Class DashStyle

Namespace
Avalonia.Media
Assembly
Avalonia.Base.dll

Represents the sequence of dashes and gaps that will be applied by a Pen.

public sealed class DashStyle : Animatable, INotifyPropertyChanged, IDashStyle
Inheritance
DashStyle
Implements
Inherited Members
Extension Methods

Constructors

DashStyle()

Initializes a new instance of the DashStyle class.

public DashStyle()

DashStyle(IEnumerable<double>?, double)

Initializes a new instance of the DashStyle class.

public DashStyle(IEnumerable<double>? dashes, double offset)

Parameters

dashes IEnumerable<double>

The dashes collection.

offset double

The dash sequence offset.

Fields

DashesProperty

Defines the Dashes property.

public static readonly StyledProperty<AvaloniaList<double>?> DashesProperty

Field Value

StyledProperty<AvaloniaList<double>>

OffsetProperty

Defines the Offset property.

public static readonly StyledProperty<double> OffsetProperty

Field Value

StyledProperty<double>

Properties

Dash

Represents a dashed DashStyle.

public static IDashStyle Dash { get; }

Property Value

IDashStyle

DashDot

Represents a dashed dotted DashStyle.

public static IDashStyle DashDot { get; }

Property Value

IDashStyle

DashDotDot

Represents a dashed double dotted DashStyle.

public static IDashStyle DashDotDot { get; }

Property Value

IDashStyle

Dashes

Gets or sets the length of alternating dashes and gaps.

public AvaloniaList<double>? Dashes { get; set; }

Property Value

AvaloniaList<double>

Dot

Represents a dotted DashStyle.

public static IDashStyle Dot { get; }

Property Value

IDashStyle

Offset

Gets or sets how far in the dash sequence the stroke will start.

public double Offset { get; set; }

Property Value

double

Methods

OnPropertyChanged(AvaloniaPropertyChangedEventArgs)

Called when a avalonia property changes on the object.

protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change)

Parameters

change AvaloniaPropertyChangedEventArgs

The property change details.

ToImmutable()

Returns an immutable clone of the DashStyle.

public ImmutableDashStyle ToImmutable()

Returns

ImmutableDashStyle