CircularProgressBar Class
A ring-shaped progressbar control.
[TemplatePart(Name = "PART_ProgressElement", Type = typeof(FrameworkElement))]
public class CircularProgressBar : RangeBase
Constructors
CircularProgressBar()
Initializes an instance of the class.
public CircularProgressBar()
Properties
EndAngle
The indicator end angle in degrees.
public double EndAngle { get; }
Property Value
- double:
A read-only resolved value for use in the control's template.
HasProgressText
Indicates whether the control currently can display progress text.
public bool HasProgressText { get; }
Property Value
- bool:
A read-only resolved value for use in the control's template.
IndicatorBrush
The Brush to use for rendering the progress bar indicator.
public Brush? IndicatorBrush { get; set; }
Property Value
- Brush:
The default value is assigned by the theme.
IsAnimationEnabled
Indicates whether animations are enabled for an element, when supported.
IsIndeterminate
Indicates whether the control is spinning in an indeterminate state, which is a state in which no specific progress value can be displayed.
IsProgressTextAllowed
Indicates whether the control is allowed to display progress text.
public bool IsProgressTextAllowed { get; set; }
Property Value
- bool:
The default value is
true.
Remarks
Progress text is never displayed when IsIndeterminate is true.
LineCap
The ring line cap.
LineDashArray
The collection of double values that indicate the pattern of dashes and gaps that is used to draw the ring line.
public DoubleCollection? LineDashArray { get; set; }
Property Value
- DoubleCollection:
The default value is
null.
LineDashOffset
The offset of the ring line's dashes.
LineThickness
The ring line thickness.
Percentage
The overall percentage of progress completed, in the range 0.0..1.0.
public double Percentage { get; }
Property Value
- double:
A read-only resolved value for use in the control's template.
Remarks
This property is automatically using the current Value and the effective range (Maximum - Minimum).
ProgressText
The formatted progress text to display.
public string? ProgressText { get; }
Property Value
- string:
A read-only resolved value for use in the control's template.
ProgressTextFormat
The format string to use for progress text.
public string ProgressTextFormat { get; set; }
Property Value
- string:
The default value is based on the current culture.
Radius
The ring's outer radius, from which the ring is rendered inward.
public double Radius { get; }
Property Value
- double:
A read-only resolved value for use in the control's template.
RotationAngle
The indicator rotation angle in degrees.
public double RotationAngle { get; }
Property Value
- double:
A read-only resolved value for use in the control's template.
StartAngle
The indicator start angle in degrees.
public double StartAngle { get; }
Property Value
- double:
A read-only resolved value for use in the control's template.
TrackBrush
The Brush to use for rendering the progress bar track.
public Brush? TrackBrush { get; set; }
Property Value
- Brush:
The default value is assigned by the theme.
Methods
ArrangeOverride(Size)
Called to arrange and size the content of a Control object.
protected override Size ArrangeOverride(Size finalSize)
| Parameter | Type | Description |
|---|---|---|
| finalSize | Size |
Returns
- Size:
The size of the control.
MeasureOverride(Size)
Called to remeasure a control.
protected override Size MeasureOverride(Size availableSize)
| Parameter | Type | Description |
|---|---|---|
| availableSize | Size |
Returns
- Size:
The size of the control, up to the maximum specified by
constraint.
OnApplyTemplate()
When overridden in a derived class, is invoked whenever application code or internal processes call ApplyTemplate().
public override void OnApplyTemplate()
OnCreateAutomationPeer()
Returns class-specific AutomationPeer implementations for the Windows Presentation Foundation (WPF) infrastructure.
protected override AutomationPeer OnCreateAutomationPeer()
Returns
- AutomationPeer:
The type-specific AutomationPeer implementation.
OnMaximumChanged(double, double)
Called when the Maximum property changes.
protected override void OnMaximumChanged(double oldMaximum, double newMaximum)
| Parameter | Type | Description |
|---|---|---|
| oldMaximum | double | Old value of the Maximum property. |
| newMaximum | double | New value of the Maximum property. |
OnMinimumChanged(double, double)
Called when the Minimum property changes.
protected override void OnMinimumChanged(double oldMinimum, double newMinimum)
| Parameter | Type | Description |
|---|---|---|
| oldMinimum | double | Old value of the Minimum property. |
| newMinimum | double | New value of the Minimum property. |
OnValueChanged(double, double)
Raises the ValueChanged routed event.
protected override void OnValueChanged(double oldValue, double newValue)
| Parameter | Type | Description |
|---|---|---|
| oldValue | double | Old value of the Value property. |
| newValue | double | New value of the Value property. |
Fields
EndAngleProperty
Defines the EndAngle property.
public static readonly DependencyProperty EndAngleProperty
HasProgressTextProperty
Defines the HasProgressText property.
public static readonly DependencyProperty HasProgressTextProperty
IndicatorBrushProperty
Defines the IndicatorBrush property.
public static readonly DependencyProperty IndicatorBrushProperty
IsAnimationEnabledProperty
Defines the IsAnimationEnabled property.
public static readonly DependencyProperty IsAnimationEnabledProperty
IsIndeterminateProperty
Defines the IsIndeterminate property.
public static readonly DependencyProperty IsIndeterminateProperty
IsProgressTextAllowedProperty
Defines the IsProgressTextAllowed property.
public static readonly DependencyProperty IsProgressTextAllowedProperty
LineCapProperty
Defines the LineCap property.
public static readonly DependencyProperty LineCapProperty
LineDashArrayProperty
Defines the LineDashArray property.
public static readonly DependencyProperty LineDashArrayProperty
LineDashOffsetProperty
Defines the LineDashOffset property.
public static readonly DependencyProperty LineDashOffsetProperty
LineThicknessProperty
Defines the LineThickness property.
public static readonly DependencyProperty LineThicknessProperty
PercentageProperty
Defines the Percentage property.
public static readonly DependencyProperty PercentageProperty
ProgressTextFormatProperty
Defines the ProgressTextFormat property.
public static readonly DependencyProperty ProgressTextFormatProperty
ProgressTextProperty
Defines the ProgressText property.
public static readonly DependencyProperty ProgressTextProperty
RadiusProperty
Defines the Radius property.
public static readonly DependencyProperty RadiusProperty
RotationAngleProperty
Defines the RotationAngle property. This field is template use only.
public static readonly DependencyProperty RotationAngleProperty
StartAngleProperty
Defines the StartAngle property.
public static readonly DependencyProperty StartAngleProperty
TrackBrushProperty
Defines the TrackBrush property.
public static readonly DependencyProperty TrackBrushProperty