ProgressBar

A ProgressBar is a control control that represents progress as a horizontal bar visually.


        <StackLayout Margin="20">
            <Label Text="Project Progress" />
            <ProgressBar x:Name="progressBar"
                            Margin="10"
                            Progress="0.5" />
            <Button Text="Progress to 80" 
                    Clicked="OnButtonClicked" />
        </StackLayout>
                

You can get the value of the ProgressBar with the following:

progressBar.Progress

Or set the value of the ProgressBar with the following:

progressBar.Progress = 0.2;

You can also animate the progress bar to anywhere from 0 to 1 with the following:


        async void OnButtonClicked(object sender, EventArgs args)
        {
            await progressBar.ProgressTo(0.75, 500, Easing.Linear);
        }
                

Download

.NET MAUI