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
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
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
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
IsCompleted
public bool IsCompleted { get; }
Property Value
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 isfalse
.
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 isfalse
.
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.
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 |
Events
StateChanged
Occurs when the StateChanged is changed.
public event EventHandler<OperationStatePropertyChangedRoutedEventArgs> StateChanged
Event Type
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