WPF中如何使用BusyIndicator
一、下载dll:http://wpftoolkit.codeplex.com/releases/view/99072
下载之后将WPFToolkit引用到WPF项目下;
二、添加命名空间:
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
三、使用/设置(三种效果):
1.
<xctk:BusyIndicator IsBusy="True" > <ContentControl Style="{StaticResource SampleContent}"/> </xctk:BusyIndicator>
2.
<xctk:BusyIndicator IsBusy="True" BusyContent="Downloading email..." > <ContentControl Style="{StaticResource SampleContent}"/> </xctk:BusyIndicator>
3.
<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>
参考引用:http://wpftoolkit.codeplex.com/wikipage?title=BusyIndicator&referringTitle=Home