Back to Devexpress

ToolTipOptions.OpenMode Property

wpf-devexpress-dot-xpf-dot-treemap-dot-tooltipoptions.md

latest5.6 KB
Original Source

ToolTipOptions.OpenMode Property

Gets or sets the opening mode of tooltips.

Namespace : DevExpress.Xpf.TreeMap

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

NuGet Package : DevExpress.Wpf.TreeMap

Declaration

csharp
public ToolTipOpenMode OpenMode { get; set; }
vb
Public Property OpenMode As ToolTipOpenMode

Property Value

TypeDescription
ToolTipOpenMode

A ToolTipOpenMode enumeration value.

|

Available values:

NameDescription
OnHover

A tooltip appears when hovering over a particular tree map item.

| | OnClick |

A tooltip appears when clicking a particular tree map item.

|

Property Paths

You can access this nested property as listed below:

Object TypePath to OpenMode
HierarchicalChartControlBase

.ToolTipOptions .OpenMode

|

Remarks

For more information about tooltips, refer to the Tooltips topic.

Example

The following properties allow you to customize TreeMap tooltips:

xaml
<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>

See Also

ToolTipOptions Class

ToolTipOptions Members

DevExpress.Xpf.TreeMap Namespace