Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wpf BusyIndicator的进度环模板_Wpf_Progress Bar_Datatemplate_Wpftoolkit_Busyindicator - Fatal编程技术网

Wpf BusyIndicator的进度环模板

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=

wpf扩展工具包有一个BusyIndicator控件,可以将模板应用于该控件中包含的进度条。 我希望进度条像Win8中的环形进度条(就像代码项目中的一样),但我不能应用控件,只能应用数据模板。
有什么想法吗?

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并简单地围绕其自身无限旋转