当前位置: 动力学知识库 > 问答 > 编程问答 >

wpf - MahApps Progress Indicator not stretching to content

问题描述:

I have a MahApps progress indicator declared like this:

<Controls:ProgressIndicator ProgressColour="{StaticResource AccentColorBrush}" Width="600" Height="20" VerticalAlignment="Top" HorizontalAlignment="Stretch"

Visibility="{Binding ElementName=Self, Path=DataContext.ShowProgress, Converter={StaticResource b2v}, FallbackValue=Visible}"/>

And for some reason the indicator bars do not stretch the size of the control. It only fills about 20% of the width. (I can't show a picture as my reputation is too low).

Has anyone experienced this before?

Cheers

Edit

The indicator is on a stackpanel declared like this:

<StackPanel Grid.Column="2" Grid.ColumnSpan="6" Orientation="Vertical">

网友答案:

Update:

In the latest version from nuget or Github ProgressIndicator seems to be removed(cos it was buggy).

Pull request that removed the control early this year

This release, again, contains some breaking changes. We try to break things now rather than later, when we release version 1.0 (which is hopefully soon).

A quick overview:

ProgressIndicator is now removed, as it wasn't working as expected. Use MetroProgressBar with IsIndeterminate = True instead, which should give a much smoother experience.

I just tried the sample with

<Controls:MetroProgressBar Width="300"
                            Margin="0, 10, 0, 0"
                            Foreground="{DynamicResource AccentColorBrush}"
                            IsIndeterminate="True"
                            Maximum="100"
                            Minimum="0" />

分享给朋友:
您可能感兴趣的文章:
随机阅读: