Why does the progress bar revert to it's original background color?

In a page's xaml, I define a ProgressBar to be at the top of the page that gets updated based off of my viewmodel. The ProgressBar becomes visible and displays as green initially, but once the download is finished (IsDownloading = false) opacity will be set to 0. Right before the opacity is set to 0, the progress bar reverts to the default BackgroundColor.

Why does this happen? Is there a way to prevent this?

Xaml:

            <ProgressBar Progress="{Binding Percentage}"
                         BackgroundColor="MediumSpringGreen"
                         HeightRequest="2"
                         HorizontalOptions="Fill"
                         Margin="0"
                         Opacity="{Binding IsDownloading, Converter={StaticResource boolToInt}}"
                         />

Answers

  • PrabakaranRamasamyPrabakaranRamasamy USMember ✭✭✭

    Use IsVisible property of ProgressBar to make it invisible, instead of reducing the Opacity.

  • The problem with that is when changing visibility all of the content below it will move, which really looks weird.

Sign In or Register to comment.