如何在Silverlight中获取busyIndi​​cator的progressBar的值?

时间:2011-11-28 08:18:58

标签: silverlight busyindicator

我想知道如何在Silverlight中获取BusyIndi​​ccator进度条的百分比值? 我是使用此控件的新手。 我希望我能得到我的问题的答案。 谢谢!

1 个答案:

答案 0 :(得分:0)

BusyIndi​​cator没有progressValue,它只是一个可视元素来显示正在发生的事情。 但是,您可以查看示例如何更改此内容:

 <controlsToolkit:HeaderedContentControl
                Grid.Column="2"
                Header="Custom Content"
                Style="{StaticResource SampleContainer}">
                <controlsToolkit:BusyIndicator
                    IsBusy="True"
                    DisplayAfter="0">
                    <controlsToolkit:BusyIndicator.BusyContentTemplate>
                        <DataTemplate>
                            <StackPanel Margin="4" >
                                <TextBlock Text="Downloading Email" FontWeight="Bold" HorizontalAlignment="Center"/>
                                <StackPanel Margin="4">
                                    <TextBlock Text="Downloading message 4/10..."/>
                                    <ProgressBar Value="40" Height="15"/>
                                </StackPanel>
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                    </Grid.ColumnDefinitions>
                                    <Button Grid.Column="0" Content="Pause" HorizontalAlignment="Right" Margin="0 0 2 0"/>
                                    <Button Grid.Column="1" Content="Cancel" HorizontalAlignment="Left" Margin="2 0 0 0"/>
                                </Grid>
                            </StackPanel>
                        </DataTemplate>
                    </controlsToolkit:BusyIndicator.BusyContentTemplate>
                    <controlsToolkit:BusyIndicator.OverlayStyle>
                        <Style TargetType="Rectangle">
                            <Setter Property="Fill" Value="#ffffeeee"/>
                        </Style>
                    </controlsToolkit:BusyIndicator.OverlayStyle>
                    <controlsToolkit:BusyIndicator.ProgressBarStyle>
                        <Style TargetType="ProgressBar">
                            <Setter Property="Visibility" Value="Collapsed"/>
                        </Style>
                    </controlsToolkit:BusyIndicator.ProgressBarStyle>
                    <ContentControl Style="{StaticResource SampleContent}"/>
                </controlsToolkit:BusyIndicator>
            </controlsToolkit:HeaderedContentControl>

链接:Silverlight samples