Wpf BusyIndicator的进度环模板
wpf扩展工具包有一个BusyIndicator控件,可以将模板应用于该控件中包含的进度条。 我希望进度条像Win8中的环形进度条(就像代码项目中的一样),但我不能应用控件,只能应用数据模板。Wpf BusyIndicator的进度环模板,wpf,progress-bar,datatemplate,wpftoolkit,busyindicator,Wpf,Progress Bar,Datatemplate,Wpftoolkit,Busyindicator,wpf扩展工具包有一个BusyIndicator控件,可以将模板应用于该控件中包含的进度条。 我希望进度条像Win8中的环形进度条(就像代码项目中的一样),但我不能应用控件,只能应用数据模板。 有什么想法吗?BusyIndicator是作为内容控件设计的。这意味着它包装了你放在里面的内容,并在上面做广告。您可以为其创建一个ControlTemplate,但必须将其设置为如下所示: <Style TargetType="{x:Type xctk:BusyIndicator}" x:Key=
有什么想法吗?BusyIndicator是作为内容控件设计的。这意味着它包装了你放在里面的内容,并在上面做广告。您可以为其创建一个ControlTemplate,但必须将其设置为如下所示:
<Style TargetType="{x:Type xctk:BusyIndicator}" x:Key="ProgressRing">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type xctk:BusyIndicator}">
<Grid>
<ContentControl Content="{TemplateBinding Content}"></ContentControl>
<Border HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
x:Name="Overlay" Visibility="{TemplateBinding IsBusy, Converter={StaticResource BoolToVis}}">
<Border.Background>
<SolidColorBrush Color="Black" Opacity="0.5"></SolidColorBrush>
</Border.Background>
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center">progress</TextBlock>
</Border>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
进步
这与BusyIndicator的构建方式类似,但允许您替换它使用的进度条。只需更换
顺便说一句,对于进度环,您可以使用imageview并简单地围绕其自身无限旋转