Skip to main content
All docs
V23.2

Title.ContentTemplate Property

Gets or sets the template used to display the title’s content.

Namespace: DevExpress.Xpf.TreeMap

Assembly: DevExpress.Xpf.TreeMap.v23.2.dll

NuGet Package: DevExpress.Wpf.TreeMap

Declaration

public DataTemplate ContentTemplate { get; set; }

Property Value

Type Description
DataTemplate

A DataTemplate object that specifies the title content template.

Example

How to: Add Multiple Titles to a TreeMap

This example adds two titles to a treemap and customizes title settings such as content, font, and alignment.

Treemap titles

<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:TreemapExample"
        xmlns:dxtm="http://schemas.devexpress.com/winfx/2008/xaml/treemap" 
        x:Class="TreemapExample.MainWindow"
        mc:Ignorable="d"
        Title="MainWindow" Height="450" Width="800">
    <Grid>
            <dxtm:TreeMapControl x:Name="treemap">
                <dxtm:TreeMapControl.Titles>
                    <dxtm:Title Content="US Largest Companies" FontSize="18" FontFamily="Tahoma" 
                                HorizontalPosition="Center" VerticalPosition="TopOutside">
                        <dxtm:Title.ContentTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal" Margin="12,12,12,0">
                                    <TextBlock Text="{Binding}" Margin="4"/>
                                    <Image Source="Icon.png" Height="32" Width="32"/>
                                </StackPanel>
                            </DataTemplate>
                        </dxtm:Title.ContentTemplate>
                    </dxtm:Title>
                    <dxtm:Title Content="in 2011" Margin="0,0,0,10" 
                                HorizontalPosition="Center" VerticalPosition="TopOutside"/>
                </dxtm:TreeMapControl.Titles>
                <!-- Data binding settings are skipped. -->
            </dxtm:TreeMapControl>
    </Grid>
</Window>
See Also