# Custom Content

`RadProgressBar` supports setting a complex structure of elements to the `ContentTemplate` property to represent the value set for the `Content` property. The Content property is of type **object** and can hold a value of any type.

**Setting the Content and ContentTemplate properties**

```XAML
<telerik:RadProgressBar x:Name="progressBar"
                    Minimum="0"
                    Maximum="100"
                    Value="75"
                    Content="{Binding ElementName=progressBar, Path=Value}">
    <telerik:RadProgressBar.ContentTemplate>
        <DataTemplate>
            <StackPanel Orientation="Vertical">
                <TextBlock Text="{Binding Path=., StringFormat={}{0}%}" 
                       TextAlignment="Center" 
                       FontSize="16" 
                       FontWeight="SemiBold"/>
                <TextBlock Text="Completed"  
                       FontSize="16" 
                       FontWeight="SemiBold"/>
            </StackPanel>
        </DataTemplate>
    </telerik:RadProgressBar.ContentTemplate>
</telerik:RadProgressBar>
```

> caption RadProgressBar with set content and ContentTemplate properties

![WPF RadProgressBar with set Content and ContentTemplate properties](https://www.telerik.com/products/wpf/documentation/assets/7b031fc40193e790b5187d00085ff332/progressbar-custom-content-0.png)

## Setting Content Foreground

RadProgressBar exposes the `ContentForeground` property that will allow you to set the foreground color for the content. It will also be applied when having a custom DataTemplate for the ContentTemplate property without explicitly setting the Foreground property of the elements inside of it.

**Setting the ContentForeground property**

```XAML
<telerik:RadProgressBar x:Name="progressBar2"
                    Minimum="0"
                    Maximum="100"
                    Value="75"
                    ContentForeground="#FF0099BC"
                    Content="{Binding ElementName=progressBar2, Path=Value}">
    <telerik:RadProgressBar.ContentTemplate>
        <DataTemplate>
            <StackPanel Orientation="Vertical">
                <TextBlock Text="{Binding Path=., StringFormat={}{0}%}" 
                       TextAlignment="Center" 
                       FontSize="16" 
                       FontWeight="SemiBold"/>
                <TextBlock Text="Completed"  
                       FontSize="16" 
                       FontWeight="SemiBold"/>
            </StackPanel>
        </DataTemplate>
    </telerik:RadProgressBar.ContentTemplate>
</telerik:RadProgressBar>
```

> caption RadProgressBar with set ContentForeground property

![WPF RadProgressBar with set ContentForeground property](https://www.telerik.com/products/wpf/documentation/assets/d9983a5c74e0e7e816230a5970b79473/progressbar-custom-content-1.png)

## Setting Vertical Content Alignment

The RadProgressBar control allows you to position the content via the `VerticalContentAlignment` property.

**Setting the VerticalContentAlignment property to Top**

```XAML
<telerik:RadProgressBar x:Name="progressBar3"
                    Minimum="0"
                    Maximum="100"
                    Value="75"
                    ContentForeground="#FF0099BC"
                    VerticalContentAlignment="Top"
                    Content="{Binding ElementName=progressBar3, Path=Value}">
    <telerik:RadProgressBar.ContentTemplate>
        <DataTemplate>
            <StackPanel Orientation="Vertical">
                <TextBlock Text="{Binding Path=., StringFormat={}{0}%}" 
                       TextAlignment="Center" 
                       FontSize="16" 
                       FontWeight="SemiBold"/>
                <TextBlock Text="Completed"  
                       FontSize="16" 
                       FontWeight="SemiBold"/>
            </StackPanel>
        </DataTemplate>
    </telerik:RadProgressBar.ContentTemplate>
</telerik:RadProgressBar>
```

> caption RadProgressBar with set VerticalContentAlignment property

![WPF RadProgressBar with set VerticalContentAlignment property](https://www.telerik.com/products/wpf/documentation/assets/d98332760ea8610948eb6bd3d837bc6d/progressbar-custom-content-2.png)
