ProgressBar ProgressBar ProgressBar Class

Represents a control that indicates the progress of an operation, where the typical visual appearance is a bar that animates a filled area as progress continues.

Syntax

Declaration

public class ProgressBarpublic class ProgressBarPublic Class ProgressBar
<ProgressBar .../>

Inheritance Hierarchy

Inherited Members

Inherited properties

, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Tag
Tag
Tag
, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Inherited events

, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Inherited methods

, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Remarks

A ProgressBar control visually indicates progress of an operation with one of two styles: a bar that displays a repeating pattern, or a bar that fills based on a value.

Indeterminate progress bar control

Progress bar control

The IsIndeterminate property determines the appearance of a ProgressBar.

Notes for Windows 8.x

Windows 8.x In an app compiled for Windows 8, when the ProgressBar is indeterminate, the progress animation continues even if it's not visible on the screen, such as when the ProgressBar Visibility is Visibility. This can keep the UI thread awake, use resources, and impair app performance. When the ProgressBar is not visible, you should disable the animation by setting IsIndeterminate to false.

Examples

The following example demonstrates a value-based ProgressBar and an indeterminate ProgressBar.

<StackPanel x:Name="LayoutRoot">
    <StackPanel BorderBrush="Black" BorderThickness="4" Padding="12">
        <TextBlock Text="Value-Based Progress Bar"/>
        <ProgressBar x:Name="progressBar1" Value="0" Maximum="200" Margin="0,12"/>
        <RepeatButton Content="Press and hold" Click="RepeatButton_Click"/>
    </StackPanel>
    <StackPanel BorderThickness="4" BorderBrush="Black" Padding="12">
        <TextBlock Text="Indeterminate Progress Bar"/>
        <ProgressBar IsIndeterminate="True" Margin="0,12"/>
    </StackPanel>
</StackPanel>

private static int _clicks = 0;

private void RepeatButton_Click(object sender, RoutedEventArgs e)
{
    _clicks += 1;
    progressBar1.Value = _clicks;
    if (_clicks >= progressBar1.Maximum) _clicks = 0;
}

Constructors summary

Initializes a new instance of the ProgressBar class.

Properties summary

Gets or sets a value that indicates whether the progress bar reports generic progress with a repeating pattern or reports progress based on the Value property.

Identifies the IsIndeterminate dependency property.

Gets or sets a value that indicates whether the progress bar should use visual states that communicate an Error state to the user.

Identifies the ShowError dependency property.

Gets or sets a value that indicates whether the progress bar should use visual states that communicate a Paused state to the user.

Identifies the ShowPaused dependency property.

Gets an object that provides calculated values that can be referenced as TemplateBinding sources when defining templates for a ProgressBar control.

Constructors

  • ProgressBar()
    ProgressBar()
    ProgressBar()
    ProgressBar()

    Initializes a new instance of the ProgressBar class.

    public ProgressBar()public New()Public Sub New()public ProgressBar()

Properties

  • IsIndeterminate
    IsIndeterminate
    IsIndeterminate
    IsIndeterminate

    Gets or sets a value that indicates whether the progress bar reports generic progress with a repeating pattern or reports progress based on the Value property.

    public bool IsIndeterminate { get; set; }public bool IsIndeterminate { get; set; }Public ReadWrite Property IsIndeterminate As boolpublic bool IsIndeterminate { get; set; }
    <ProgressBar IsIndeterminate="bool"/>
    

    Property Value

    • bool
      bool
      bool

      ** True** if the progress bar reports generic progress with a repeating pattern; false if the progress bar reports progress based on the Value property. The default is false.

    Remarks

    Notes for Windows 8.x

    Windows 8.x In an app compiled for Windows 8, when the ProgressBar is indeterminate, the progress animation continues even if it's not visible on the screen, such as when the ProgressBar Visibility is collapsed. This can keep the UI thread awake, use resources, and impair app performance. When the ProgressBar is not visible, you should disable the animation by setting IsIndeterminate to false.

  • IsIndeterminateProperty
    IsIndeterminateProperty
    IsIndeterminateProperty
    IsIndeterminateProperty

    Identifies the IsIndeterminate dependency property.

    public static DependencyProperty IsIndeterminateProperty { get; }public static DependencyProperty IsIndeterminateProperty { get; }Public Static ReadOnly Property IsIndeterminateProperty As DependencyPropertypublic static DependencyProperty IsIndeterminateProperty { get; }

    Property Value

  • ShowError
    ShowError
    ShowError
    ShowError

    Gets or sets a value that indicates whether the progress bar should use visual states that communicate an Error state to the user.

    public bool ShowError { get; set; }public bool ShowError { get; set; }Public ReadWrite Property ShowError As boolpublic bool ShowError { get; set; }
    <ProgressBar ShowError="bool"/>
    

    Property Value

    • bool
      bool
      bool

      True if the progress bar should use visual states that communicate an Error state to the user; otherwise, false. The default is false.

  • ShowErrorProperty
    ShowErrorProperty
    ShowErrorProperty
    ShowErrorProperty

    Identifies the ShowError dependency property.

    public static DependencyProperty ShowErrorProperty { get; }public static DependencyProperty ShowErrorProperty { get; }Public Static ReadOnly Property ShowErrorProperty As DependencyPropertypublic static DependencyProperty ShowErrorProperty { get; }

    Property Value

  • ShowPaused
    ShowPaused
    ShowPaused
    ShowPaused

    Gets or sets a value that indicates whether the progress bar should use visual states that communicate a Paused state to the user.

    public bool ShowPaused { get; set; }public bool ShowPaused { get; set; }Public ReadWrite Property ShowPaused As boolpublic bool ShowPaused { get; set; }
    <ProgressBar ShowPaused="bool"/>
    

    Property Value

    • bool
      bool
      bool

      True if the progress bar should use visual states that communicate a Paused state to the user; otherwise, false. The default is false.

  • ShowPausedProperty
    ShowPausedProperty
    ShowPausedProperty
    ShowPausedProperty

    Identifies the ShowPaused dependency property.

    public static DependencyProperty ShowPausedProperty { get; }public static DependencyProperty ShowPausedProperty { get; }Public Static ReadOnly Property ShowPausedProperty As DependencyPropertypublic static DependencyProperty ShowPausedProperty { get; }

    Property Value

  • TemplateSettings
    TemplateSettings
    TemplateSettings
    TemplateSettings

    Gets an object that provides calculated values that can be referenced as TemplateBinding sources when defining templates for a ProgressBar control.

    public ProgressBarTemplateSettings TemplateSettings { get; }public ProgressBarTemplateSettings TemplateSettings { get; }Public ReadOnly Property TemplateSettings As ProgressBarTemplateSettingspublic ProgressBarTemplateSettings TemplateSettings { get; }

    Property Value

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ComposableAttribute
Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute
Windows.Foundation.Metadata.StaticAttribute
Windows.Foundation.Metadata.ThreadingAttribute
Windows.Foundation.Metadata.WebHostHiddenAttribute

Details

Assembly

Windows.UI.Xaml.Controls.dll