Skip to main content

Annotation.ContentTemplate Property

Gets or sets the data template to display the annotation content.

Namespace: DevExpress.Xpf.Charts

Assembly: DevExpress.Xpf.Charts.v24.1.dll

NuGet Package: DevExpress.Wpf.Charts

Declaration

public DataTemplate ContentTemplate { get; set; }

Property Value

Type Description
DataTemplate

A DataTemplate object specifying the annotation content presentation.

Example

This example demonstrates how to bind a chart annotation to a content template.

To use the data template for annotation content, create a DataTemplate object defining how to represent annotation content and assign this template to the Annotation.ContentTemplate property.

<dxc:Annotation.Content>
    <local:AnnotationContent Text="Annotation"
                             ImageSource="{StaticResource imageSource}"/>
</dxc:Annotation.Content>
<dxc:Annotation.ContentTemplate>
    <DataTemplate>
        <StackPanel Orientation="Horizontal">
            <Label 
                   Margin="0,0,4,0" 
                   Content="{Binding Text}"/>
            <Image 
                   Width="48" 
                   Height="48">
                <Image.Source>
                    <BitmapImage UriSource="{Binding ImageSource}"/>
                </Image.Source>
            </Image>
        </StackPanel>
    </DataTemplate>
</dxc:Annotation.ContentTemplate>
See Also