我需要创建一个圆形ProgressBar模板。
控制模板:
<ControlTemplate TargetType="{x:Type ProgressBar}">
<Grid x:Name="TemplateRoot" SnapsToDevicePixels="true">
<Rectangle x:Name="PART_Track" Margin="1" Fill="White" />
<Border x:Name="PART_Indicator" HorizontalAlignment="Left" Margin="1" >
<Grid x:Name="Foreground" >
<Rectangle x:Name="Indicator" Fill="{TemplateBinding Background}" />
<Grid x:Name="Animation" ClipToBounds="true" >
<Rectangle x:Name="PART_GlowRect" Fill="#FF86C7EB"
HorizontalAlignment="Left" Margin="-100,0,0,0" Width="100"/>
</Grid>
</Grid>
</Border>
<Border x:Name="roundBorder" BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="10" />
<TextBlock />
</Grid>
</ControlTemplate>
这导致:

左侧的 LightBlue 矩形在哪里PART_Indicator(其宽度在控件内部设置ProgressBar,如此处所示,值为 20)和roundBorder.
我需要的是让 thePART_Indicator夹在 上roundBorder,结果如下:

