Skip to main content
A newer version of this page is available.
All docs
V18.2

TreeMapControl.ToolTipTemplate Property

Gets or sets the template that defines the presentation of the TreeMap tooltip.

Namespace: DevExpress.Xpf.TreeMap

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

Declaration

[NonCategorized]
public DataTemplate ToolTipTemplate { get; set; }

Property Value

Type Description
DataTemplate

A DataTemplate object defining a TreeMap tooltip presentation template.

Example

The following properties allow you to customize TreeMap tooltips.

<Window.Resources>
    <DataTemplate x:Key="tooltipContentTemplate">
        <StackPanel Orientation="Vertical"
                    Margin="8">
            <TextBlock Text="{Binding Item.Label}"
                       Foreground="White" 
                       FontSize="24"/>
            <TextBlock Text="{Binding Path=ToolTipText}"
                       Foreground="LightGray"/>
        </StackPanel>
    </DataTemplate>
    <DataTemplate x:Key="tooltipTemplate">
        <Grid>
            <Border CornerRadius="8" 
                    Background="#FF303030">
                <ContentPresenter Content="{Binding}" 
                                  ContentTemplate="{Binding ContentTemplate}"/>
            </Border>
        </Grid>
    </DataTemplate>
</Window.Resources>
    <dxtm:TreeMapControl ToolTipEnabled="true"
                         ToolTipPattern="{}GDP: {V:C} millions"
                         ToolTipContentTemplate="{Binding Source={StaticResource tooltipContentTemplate}}"
                         ToolTipGroupPattern="{} Summary GDP: {V:C} millions"
                         ToolTipGroupContentTemplate="{Binding Source={StaticResource tooltipContentTemplate}}"
                         ToolTipTemplate="{Binding Source={StaticResource tooltipTemplate}}">
        <dxtm:TreeMapControl.ToolTipOptions>
            <dxtm:ToolTipOptions Position="{Binding ElementName=lbPosition, Path=SelectedValue}"
                                 OpenMode="{Binding ElementName=lbOpenMode, Path=SelectedValue}">
            </dxtm:ToolTipOptions>
        </dxtm:TreeMapControl.ToolTipOptions>
    </dxtm:TreeMapControl>
        <ListBox Grid.Row="1"
                 x:Name="lbPosition"
                 DisplayMemberPath="PositionName"
                 SelectedValuePath="Position"
                 SelectedIndex="0">
            <local:PositionWrapper PositionName="Mouse">
                <dxtm:ToolTipMousePosition/>
            </local:PositionWrapper>
            <local:PositionWrapper PositionName="Relative">
                <dxtm:ToolTipRelativePosition Origin="0.5 0"/>
            </local:PositionWrapper>
        </ListBox>
        <ListBox Grid.Row="3"
                 x:Name="lbOpenMode"
                 DisplayMemberPath="OpenModeName"
                 SelectedValuePath="OpenMode"
                 SelectedIndex="0">
            <local:OpenModeWrapper OpenModeName="On Hover" 
                                   OpenMode="OnHover"/>
            <local:OpenModeWrapper OpenModeName="On Click" 
                                   OpenMode="OnClick"/>
        </ListBox>

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ToolTipTemplate 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.

See Also