Annotation.ContentTemplate Property
Gets or sets the data template to display the annotation content.
Namespace: DevExpress.Xpf.Charts
Assembly: DevExpress.Xpf.Charts.v19.2.dll
Declaration
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.
Note
A complete sample project is available at https://github.com/DevExpress-Examples/how-to-customize-annotation-content-t380028.
<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>
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the ContentTemplate property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.