PinnableTooltips

This is ToolTip that can be pinned by user.

Inherits from System.Windows.Controls.ContentControl.

Hover the owner control to see the tool tips. Move tool tip to automatically pin it. PinnableToolTip works with asistance of PinnableToolTipService that exposes attached properties to attach tool tips to controls.

PinnableTooltip 01

Properties

PinnableToolTipService attached properties

Property nameDescription
InitialShowDelayUses to set initial popup show delay.
IsToolTipOwnerUses to set tool tip owner.
PlacementUses to set tooltip Placement.
PlacementTargetUses to set tooltip placement target.
ShowDurationUses to set tooltip duration.
ToolTipUses to attach tooltip to parent control.

PinnableToolTip

Property nameDescription
AccentColorBrushGets or sets accent color.
AllowCloseByUserGets or sets value indicating whether tool tip can be closed by user.
GripColorGets or sets tool tip grip color.
HorizontalOffsetGets or sets tool tip horizontal offset.
IsOpenGets value indicating whether tool tip is opened.
IsPinnedGets or sets value whether tool tip is pinned.
OwnerGets or sets ToolTip owner control.
ResizeModeGets or sets tool tip resize mode.
VerticalOffsetGets or sets tool tip vertical offset.

Events

Event nameDescription
IsOpenChangedOccurs when tool tip is opened/closed.
IsPinnedChangedOccurs when tool tip is pinned/unpinned.

How to use

Use PinnableToolTipService to attach tool tip to owner control.

<Border BorderThickness="1"  Width="150">
    <TextBlock Text="{Binding}" Margin="5"/>
    <orc:PinnableToolTipService.ToolTip>
        <orc:PinnableToolTip AllowCloseByUser="True" ResizeMode="CanResize" MinWidth="100" MinHeight="100"
                             HorizontalOffset="-12" VerticalOffset="-12">
            <!-- Using a content template allows to delay loading of the inner visual tree, which is much faster -->
            <orc:PinnableToolTip.ContentTemplate>
                <DataTemplate>
                    <StackPanel>
                        <Label Content="this is tool tip" />
                        <Border Margin="5" Width="50" 
                                Height="50" Background="{Binding}" />
                    </StackPanel>
                 </DataTemplate>
            </orc:PinnableToolTip.ContentTemplate>
        </orc:PinnableToolTip>
    </orc:PinnableToolTipService.ToolTip>
</Border>

If you pass any control as ToolTip to PinnableToolTipService it will be wrapped by PinnableToolTip.

<Border BorderThickness="1"  Width="150">
    <TextBlock Text="{Binding}" Margin="5"/>
    <orc:PinnableToolTipService.ToolTip>
        <StackPanel>
            <Label Content="this is tool tip" />
            <Border Margin="5" Width="50"
                    Height="50" Background="{Binding}" />
        </StackPanel>
    </orc:PinnableToolTipService.ToolTip>
</Border>

Have a question about Catel or WildGums controls? Use StackOverflow with the Catel tag!


Discussion