是否可以更改 Extended WPF Toolkit 的 Busyindicator 中的繁忙动画? [英] Is it possible to change the busy animation in the Busyindicator of Extended WPF Toolkit?

查看:25
本文介绍了是否可以更改 Extended WPF Toolkit 的 Busyindicator 中的繁忙动画?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Extended WPF Toolkit 的 Busyindicator 中的忙碌动画是否可以更改?特别是,我想将其更改为 .gif 动画.

Is it possible to change the busy animation in the Busyindicator of Extended WPF Toolkit? In particular, I would like to change it to a .gif animation.

推荐答案

是的,当然.您可以定义自己的自定义内容(文档).

Yes, of course. You can define your own custom content (documentation).

繁忙指示器自定义内容示例:

 <xctk:BusyIndicator IsBusy="True" DisplayAfter="0">
       <xctk:BusyIndicator.BusyContentTemplate>
            <DataTemplate>
                 <StackPanel Margin="4">
                          <TextBlock Text="Downloading Email" FontWeight="Bold" HorizontalAlignment="Center"/>
                           <StackPanel Margin="4">
                               <TextBlock Text="Downloading message 4/10..."/>
                               <ProgressBar Value="40" Height="15"/>
                           </StackPanel>
                           <Grid>
                               <Grid.ColumnDefinitions>
                                   <ColumnDefinition/>
                                   <ColumnDefinition/>
                               </Grid.ColumnDefinitions>
                               <Button Grid.Column="0" Content="Pause" HorizontalAlignment="Right" Margin="0 0 2 0"/>
                               <Button Grid.Column="1" Content="Cancel" HorizontalAlignment="Left" Margin="2 0 0 0"/>
                           </Grid>
                  </StackPanel>
            </DataTemplate>
       </xctk:BusyIndicator.BusyContentTemplate>
       <xctk:BusyIndicator.OverlayStyle>
                  <Style TargetType="Rectangle">
                        <Setter Property="Fill" Value="#ffffeeee"/>
                  </Style>
       </xctk:BusyIndicator.OverlayStyle>
       <xctk:BusyIndicator.ProgressBarStyle>
                   <Style TargetType="ProgressBar">
                            <Setter Property="Visibility" Value="Collapsed"/>
                   </Style>
       </xctk:BusyIndicator.ProgressBarStyle>
       <ContentControl Style="{StaticResource SampleContent}"/>
</xctk:BusyIndicator>

要在 WPF 中显示动画 GIF 图像,您可以使用 WPF 动画 GIF.

To display animated GIF images in WPF you can use WPF Animated GIF.

带有动画 GIF 的忙碌指示器:

<xctk:BusyIndicator IsBusy="True" DisplayAfter="0">
    <xctk:BusyIndicator.BusyContentTemplate>
        <DataTemplate>
            <StackPanel Margin="5">                   
                <Image gif:ImageBehavior.AnimatedSource="loading.gif" Width="100" Height="100" />
            </StackPanel>
        </DataTemplate>
    </xctk:BusyIndicator.BusyContentTemplate>
    <xctk:BusyIndicator.OverlayStyle>
        <Style TargetType="Rectangle">
            <Setter Property="Fill" Value="#ffffeeee"/>
        </Style>
    </xctk:BusyIndicator.OverlayStyle>
    <xctk:BusyIndicator.ProgressBarStyle>
        <Style TargetType="ProgressBar">
            <Setter Property="Visibility" Value="Collapsed"/>
        </Style>
    </xctk:BusyIndicator.ProgressBarStyle>
    <ContentControl />
</xctk:BusyIndicator>

这篇关于是否可以更改 Extended WPF Toolkit 的 Busyindicator 中的繁忙动画?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆