Reputation: 343
the wpf extended toolkit has a BusyIndicator control and its possible to apply a template to the progress bar contained in that control. i'm want the progress bar to be like the ring progress bar in win 8 (like here in code project http://www.codeproject.com/Articles/700185/Windows-Progress-Ring) but i can't apply a control, just a DataTemplate. any ideas?
Upvotes: 2
Views: 2705
Reputation: 5536
The BusyIndicator is designed as a content control. meaning it wraps the content you put inside and ads an overlay to it. you can create a ControlTemplate for it but you will have to make it something like this:
<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>
This is similar to how the BusyIndicator is built but allows you to replace the progress bar it uses. simply replace the
BTW for the progress ring you can use an imageview and simply rotate it around it self infinitely.
Upvotes: 3