【问题标题】:How to get the value of the progressBar of a busyIndicator in Silverlight?如何获取 Silverlight 中busyIndi​​cator 的progressBar 的值?
【发布时间】:2012-01-07 17:59:17
【问题描述】:

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

【问题讨论】:

  • 什么意思? BusyIndi​​cator 没有价值。它的 ProgressBar 的 IsIndeterminate 属性设置为 true。您可以将 IsBusy 设置为 true 或 false。否则你需要 ProgressBar 控件。

标签: silverlight busyindicator


【解决方案1】:

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

【讨论】:

  • 谢谢MBen!我会检查链接。
猜你喜欢
  • 2012-04-11
  • 2011-03-27
  • 2011-08-17
  • 2011-03-15
  • 2011-03-01
  • 2013-09-29
  • 2011-06-01
  • 1970-01-01
  • 2011-10-06
相关资源
最近更新 更多