百分比进度条

<Style TargetType="{x:Type ProgressBar}">
            <Setter Property="Maximum" Value="100" />
            <Setter Property="Height" Value="70" />
            <Setter Property="Value" Value="20" />
            <Setter Property="Foreground" Value="#40a2c2"/>
            <Setter Property="SnapsToDevicePixels" Value="True" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ProgressBar}">
                        <Grid x:Name="Root">
                            <Grid.RowDefinitions>
                                <RowDefinition></RowDefinition>
                                <RowDefinition Height="35" ></RowDefinition>
                            </Grid.RowDefinitions>
                            <Grid  Grid.Row="0">
                                <Canvas Grid.Row="0" Height="38">
                                    <Canvas x:Name="Tooltip" Canvas.Left="{Binding ActualWidth, ElementName=PART_Indicator,Converter={StaticResource progressBarValueLocationConverter}}">
                                        <Image x:Name="Shape_5" Height="30" Canvas.Left="4" Source="percentagebar_Images/Shape 5.png" Canvas.Top="2" Width="43">
                                            <Image.Effect>
                                                <DropShadowEffect BlurRadius="3" Color="Black" Direction="-90" Opacity="0.43" ShadowDepth="2"/>
                                            </Image.Effect>
                                        </Image>
                                        <TextBlock Text="{Binding Value,  RelativeSource={RelativeSource AncestorType={x:Type ProgressBar}},Converter={StaticResource progressBarValueTextFormatConverter}}" Foreground="White" FontWeight="Bold" FontSize="13" FontFamily="Helvetica75-Bold" IsHyphenationEnabled="True" LineStackingStrategy="BlockLineHeight" Canvas.Left="13" LineHeight="13" TextAlignment="Left" TextWrapping="Wrap" Canvas.Top="9.56">
                                            <TextBlock.Effect>
                                                <DropShadowEffect BlurRadius="0" Color="Black" Direction="-270" Opacity="1" ShadowDepth="1"/>
                                            </TextBlock.Effect>
                                        </TextBlock>
                                    </Canvas>
                                </Canvas>
                            </Grid>

                            <Path  Grid.Row="1" x:Name="PART_Track" Data="F1M8,1C8,1 335,1 335,1 338.866,1 342,4.134 342,8 342,11.866 338.866,15 335,15 335,15 8,15 8,15 4.134,15 1,11.866 1,8 1,4.134 4.134,1 8,1z"  Canvas.Left="0" Canvas.Top="0">
                                <Path.Effect>
                                    <DropShadowEffect BlurRadius="0" Color="White" Direction="-90" Opacity="0.26" ShadowDepth="1"/>
                                </Path.Effect>
                                <Path.Fill>
                                    <SolidColorBrush Color="Black" Opacity="0.23137254901960785"/>
                                </Path.Fill>
                            </Path>
                            <Border Grid.Row="1" x:Name="PART_Indicator" BorderBrush="Transparent" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="3,2,0,0" Height="12" MaxWidth="338" Background="{TemplateBinding Foreground}" CornerRadius="7.5,7.5,7.5,7.5" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"></Border>

                        </Grid>
                        <!--<ControlTemplate.Triggers>
                                <Trigger Property="Orientation" Value="Vertical">
                                    <Setter Property="LayoutTransform" TargetName="Root">
                                        <Setter.Value>
                                            <RotateTransform Angle="-90" />
                                        </Setter.Value>
                                    </Setter>
                                </Trigger>
                            </ControlTemplate.Triggers>-->
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
  • 7
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值