我正在尝试实现一个带有顶部文本框的进度条,该文本框还显示进度%。但百分比是分数。是否可以通过绑定对数据集中返回的值进行四舍五入,还是必须通过后面的代码来完成?四舍五入WPF绑定中的值
<ProgressBar Grid.Row="2" Grid.ColumnSpan="2" Height="25" HorizontalAlignment="Stretch" Margin="5,5,5,2" Name="pbProgressIndex" VerticalAlignment="Top" Width="Auto" Value="{Binding Path=ProgressIndex, Mode=OneWayToSource}" />
<TextBlock Grid.Row="2" Grid.ColumnSpan="2" Height="25" Name="txtProgressIndex" Text="{Binding Path=ProgressIndex, Mode=OneWayToSource}" Width="Auto" Foreground="Black" FontWeight="Bold" FontSize="14" FontFamily="Verdana" Padding="5" Margin="5,5,5,5" TextAlignment="Center" />
我结束了修改数据集圆时,它会进来,然后使用值: 文本=“{绑定路径= ProgressIndex,模式=单向, StringFormat = {} {0}%}“ – jasonk 2010-09-07 21:35:09