XAML ProgressBar

This article shows how to use the ProgressBar element to create a progress bar control in XAML.

6029

A Progress Bar is used to represent the progress of an activity that takes some time. For example, if there is a background process such as copying files and you wish to display the progress of the process, a progress bar is the best control to represent the progress.

This tutorial shows you how to create and use a ProgressBar control available in Windows Presentation Foundation (WPF) and XAML.

Introduction

The ProgressBar tag in XAML represents a WPF ProgressBar control.

<ProgressBar></ProgressBar>

The Width and Height properties represent the width and the height of a ProgressBar. The Name property represents the name of the control, which is a unique identifier of a control. The Margin property tells the location of a ProgressBar on the parent control. The HorizontalAlignment and VerticalAlignment properties are used to set horizontal and vertical alignments.

The following code snippet sets the name, height, and width of a ListView control. The code also sets horizontal alignment to left and vertical alignment to top.