Table of Contents

Class TickBar

Namespace
Avalonia.Controls
Assembly
Avalonia.Controls.dll

An element that is used for drawing Slider's Ticks.

public class TickBar : Control, INotifyPropertyChanged, IDataContextProvider, ILogical, IThemeVariantHost, IResourceHost, IResourceNode, IStyleHost, ISetLogicalParent, ISetInheritanceParent, ISupportInitialize, IStyleable, INamed, IInputElement, IDataTemplateHost, ISetterValue
Inheritance
TickBar
Implements
Inherited Members
Extension Methods

Constructors

TickBar()

public TickBar()

Fields

FillProperty

Defines the Fill property.

public static readonly StyledProperty<IBrush?> FillProperty

Field Value

StyledProperty<IBrush>

IsDirectionReversedProperty

Defines the IsDirectionReversed property.

public static readonly StyledProperty<bool> IsDirectionReversedProperty

Field Value

StyledProperty<bool>

MaximumProperty

Defines the Maximum property.

public static readonly StyledProperty<double> MaximumProperty

Field Value

StyledProperty<double>

MinimumProperty

Defines the Minimum property.

public static readonly StyledProperty<double> MinimumProperty

Field Value

StyledProperty<double>

OrientationProperty

Defines the Orientation property.

public static readonly StyledProperty<Orientation> OrientationProperty

Field Value

StyledProperty<Orientation>

PlacementProperty

Defines the Placement property.

public static readonly StyledProperty<TickBarPlacement> PlacementProperty

Field Value

StyledProperty<TickBarPlacement>

ReservedSpaceProperty

Defines the ReservedSpace property.

public static readonly StyledProperty<Rect> ReservedSpaceProperty

Field Value

StyledProperty<Rect>

TickFrequencyProperty

Defines the TickFrequency property.

public static readonly StyledProperty<double> TickFrequencyProperty

Field Value

StyledProperty<double>

TicksProperty

Defines the Ticks property.

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

Field Value

StyledProperty<AvaloniaList<double>>

Properties

Fill

Brush used to fill the TickBar's Ticks.

public IBrush? Fill { get; set; }

Property Value

IBrush

IsDirectionReversed

The IsDirectionReversed property defines the direction of value incrementation. By default, if Tick's orientation is Horizontal, ticks will be drawn from left to right. (And, bottom to top for Vertical orientation). If IsDirectionReversed is 'true' the direction of the drawing will be in opposite direction.

public bool IsDirectionReversed { get; set; }

Property Value

bool

Maximum

Logical position where the Maximum Tick will be drawn

public double Maximum { get; set; }

Property Value

double

Minimum

Logical position where the Minimum Tick will be drawn

public double Minimum { get; set; }

Property Value

double

Orientation

TickBar parent's orientation.

public Orientation Orientation { get; set; }

Property Value

Orientation

Placement

Placement property specified how the Tick will be placed. This property affects the way ticks are drawn. This property has type of TickBarPlacement.

public TickBarPlacement Placement { get; set; }

Property Value

TickBarPlacement

ReservedSpace

TickBar will use ReservedSpaceProperty for left and right spacing (for horizontal orientation) or top and bottom spacing (for vertical orientation). The space on both sides of TickBar is half of specified ReservedSpace. This property has type of Rect.

public Rect ReservedSpace { get; set; }

Property Value

Rect

TickFrequency

TickFrequency property defines how the tick will be drawn.

public double TickFrequency { get; set; }

Property Value

double

Ticks

The Ticks property contains collection of value of type Double which are the logical positions use to draw the ticks. The property value is a AvaloniaList<T>.

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

Property Value

AvaloniaList<double>

Methods

Render(DrawingContext)

Draw ticks. Ticks can be draw in 8 different ways depends on Placement property and IsDirectionReversed property.

This function also draw selection-tick(s) if IsSelectionRangeEnabled is 'true' and SelectionStart and SelectionEnd are valid.

The primary ticks (for Minimum and Maximum value) height will be 100% of TickBar's render size (use Width or Height depends on Placement property).

The secondary ticks (all other ticks, including selection-tics) height will be 75% of TickBar's render size.

Brush that use to fill ticks is specified by Fill property.

public override sealed void Render(DrawingContext dc)

Parameters

dc DrawingContext