In This Article

AnimatedProgressBar Class

Represents an animated progress bar control.

[TemplatePart(Name = "PART_Indicator", Type = typeof(FrameworkElement))]
[TemplatePart(Name = "PART_Track", Type = typeof(FrameworkElement))]
public class AnimatedProgressBar : RangeBase
Inheritance:
object Visual UIElement FrameworkElement Control RangeBase object

Remarks

For detailed documentation on this control's features and how to use them, please see the AnimatedProgressBar documentation topic.

Constructors

AnimatedProgressBar()

Initializes an instance of the class.

public AnimatedProgressBar()

Properties

DecreaseDuration

Gets or sets the Duration of the decrease animation. This is a dependency property.

public Duration DecreaseDuration { get; set; }

Property Value

Duration:

The Duration of the decrease animation. The default value is 500 milliseconds.

Remarks

This property is not used when IsAnimationEnabled is set to false.

IncreaseDuration

Gets or sets the Duration of the increase animation. This is a dependency property.

public Duration IncreaseDuration { get; set; }

Property Value

Duration:

The Duration of the increase animation. The default value is 500 milliseconds.

Remarks

This property is not used when IsAnimationEnabled is set to false.

IsAnimationEnabled

Gets or sets value indicating whether the progress bar should animate Value changes. This is a dependency property.

public bool IsAnimationEnabled { get; set; }

Property Value

bool:

true if the progress bar should animate Value changes; otherwise, false. The default value is true.

IsCompleted

Gets a value indicating whether Value is equal to Maximum. This is a dependency property.

public bool IsCompleted { get; }

Property Value

bool:

true if Value is equal to Maximum; otherwise, false.

IsContinuous

Gets or sets value indicating whether the progress bar should render a continuous or segmented indicator. This is a dependency property.

public bool IsContinuous { get; set; }

Property Value

bool:

true if the progress bar should render a continuous indicator; otherwise, false. The default value is false.

IsIndeterminate

Gets or sets a value indicating whether the AnimatedProgressBar shows actual values or generic, continuous progress feedback. This is a dependency property.

public bool IsIndeterminate { get; set; }

Property Value

bool:

false if the AnimatedProgressBar shows actual values; true if the AnimatedProgressBar shows generic progress. The default value is false.

Orientation

Gets or sets the orientation of a AnimatedProgressBar: horizontal or vertical. This is a dependency property.

public Orientation Orientation { get; set; }

Property Value

Orientation:

One of the Orientation values. The default value is Orientation.Horizontal.

State

Gets or sets the state of the AnimatedProgressBar. This is a dependency property.

public OperationState State { get; set; }

Property Value

OperationState:

The state. The default value is Normal.

Methods

OnApplyTemplate()

Attempts to locate and initialize the PART_Track and PART_Indicator parts from the applied template.

public override void OnApplyTemplate()

OnCreateAutomationPeer()

Creates an appropriate AnimatedProgressBarAutomationPeer for this control as part of the WPF infrastructure.

protected override AutomationPeer OnCreateAutomationPeer()

Returns

AutomationPeer

OnStateChanged(OperationState, OperationState)

Invoked when the State property is changed.

protected virtual void OnStateChanged(OperationState oldValue, OperationState newValue)
Parameter Type Description
oldValue OperationState

The old property value.

newValue OperationState

The new property value.

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

UpdateProgressBarIndicatorLength(bool)

Updates the length of the PART_Indicator element.

protected virtual void UpdateProgressBarIndicatorLength(bool allowAnimation)
Parameter Type Description
allowAnimation bool

if set to true the change can be animated.

Events

StateChanged

Occurs when the StateChanged is changed.

public event EventHandler<OperationStatePropertyChangedRoutedEventArgs> StateChanged

Event Type

EventHandler<OperationStatePropertyChangedRoutedEventArgs>

Fields

DecreaseDurationProperty

Identifies the DecreaseDuration dependency property. This field is read-only.

public static readonly DependencyProperty DecreaseDurationProperty

IncreaseDurationProperty

Identifies the IncreaseDuration dependency property. This field is read-only.

public static readonly DependencyProperty IncreaseDurationProperty

IsAnimationEnabledProperty

Identifies the IsAnimationEnabled dependency property. This field is read-only.

public static readonly DependencyProperty IsAnimationEnabledProperty

IsCompletedProperty

Identifies the read-only IsCompleted dependency property. This field is read-only.

public static readonly DependencyProperty IsCompletedProperty

IsContinuousProperty

Identifies the IsContinuous dependency property. This field is read-only.

public static readonly DependencyProperty IsContinuousProperty

IsIndeterminateProperty

Identifies the IsIndeterminate dependency property. This field is read-only.

public static readonly DependencyProperty IsIndeterminateProperty

OrientationProperty

Identifies the Orientation dependency property. This field is read-only.

public static readonly DependencyProperty OrientationProperty

StateChangedEvent

Identifies the StateChanged routed event. This field is read-only.

public static readonly RoutedEvent StateChangedEvent

StateProperty

Identifies the State dependency property. This field is read-only.

public static readonly DependencyProperty StateProperty