Table of Contents

Class ProgressBar

Namespace
Avalonia.Controls
Assembly
Avalonia.Controls.dll

A control used to indicate the progress of an operation.

[TemplatePart("PART_Indicator", typeof(Border), IsRequired = true)]
[PseudoClasses(new string[] { ":vertical", ":horizontal", ":indeterminate" })]
public class ProgressBar : RangeBase, INotifyPropertyChanged, IDataContextProvider, ILogical, IThemeVariantHost, IResourceHost, IResourceNode, IStyleHost, ISetLogicalParent, ISetInheritanceParent, ISupportInitialize, IStyleable, INamed, IInputElement, IDataTemplateHost, ISetterValue
Inheritance
ProgressBar
Implements
Inherited Members
Extension Methods

Constructors

ProgressBar()

Initializes a new instance of the ProgressBar class.

public ProgressBar()

Fields

IsIndeterminateProperty

Defines the IsIndeterminate property.

public static readonly StyledProperty<bool> IsIndeterminateProperty

Field Value

StyledProperty<bool>

OrientationProperty

Defines the Orientation property.

public static readonly StyledProperty<Orientation> OrientationProperty

Field Value

StyledProperty<Orientation>

PercentageProperty

Defines the Percentage property.

public static readonly DirectProperty<ProgressBar, double> PercentageProperty

Field Value

DirectProperty<ProgressBar, double>

ProgressTextFormatProperty

Defines the ProgressTextFormat property.

public static readonly StyledProperty<string> ProgressTextFormatProperty

Field Value

StyledProperty<string>

ShowProgressTextProperty

Defines the ShowProgressText property.

public static readonly StyledProperty<bool> ShowProgressTextProperty

Field Value

StyledProperty<bool>

Properties

IsIndeterminate

Gets or sets a value indicating whether the progress bar shows the actual value or a generic, continues progress indicator (indeterminate state).

public bool IsIndeterminate { get; set; }

Property Value

bool

Orientation

Gets or sets the orientation of the ProgressBar.

public Orientation Orientation { get; set; }

Property Value

Orientation

Percentage

Gets the overall percentage complete of the progress

public double Percentage { get; }

Property Value

double

Remarks

This read-only property is automatically calculated using the current Value and the effective range (Maximum - Minimum).

ProgressTextFormat

Gets or sets the format string applied to the internally calculated progress text before it is shown.

public string ProgressTextFormat { get; set; }

Property Value

string

ShowProgressText

Gets or sets a value indicating whether progress text will be shown.

public bool ShowProgressText { get; set; }

Property Value

bool

TemplateSettings

Gets or sets the TemplateSettings for the ProgressBar.

public ProgressBar.ProgressBarTemplateSettings TemplateSettings { get; }

Property Value

ProgressBar.ProgressBarTemplateSettings

Methods

ArrangeOverride(Size)

Positions child elements as part of a layout pass.

protected override Size ArrangeOverride(Size finalSize)

Parameters

finalSize Size

The size available to the control.

Returns

Size

The actual size used.

OnApplyTemplate(TemplateAppliedEventArgs)

Called when the control's template is applied. In simple terms, this means the method is called just before the control is displayed.

protected override void OnApplyTemplate(TemplateAppliedEventArgs e)

Parameters

e TemplateAppliedEventArgs

The event args.

OnCreateAutomationPeer()

Returns a new, type-specific AutomationPeer implementation for the control.

protected override AutomationPeer OnCreateAutomationPeer()

Returns

AutomationPeer

The type-specific AutomationPeer implementation.

OnPropertyChanged(AvaloniaPropertyChangedEventArgs)

Called when a avalonia property changes on the object.

protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change)

Parameters

change AvaloniaPropertyChangedEventArgs

The property change details.