I am assuming you are trying to use the Avalon Controls from here: Avalon Controls
I added a tooltip to the thumbs in the control template and called it PART_LeftToolTip
<ControlTemplate TargetType="{x:Type Controls:RangeSlider}">
<StackPanel Orientation="Horizontal" Name="PART_RangeSliderContainer">
<RepeatButton Name="PART_LeftEdge"/>
<Thumb Name="PART_LeftThumb" Cursor="SizeWE">
<Thumb.ToolTip>
<ToolTip Name="PART_LeftToolTip" />
</Thumb.ToolTip>
</Thumb>
<Thumb Name="PART_MiddleThumb" Cursor="ScrollWE" MinWidth="1"/>
<Thumb Name="PART_RightThumb" Cursor="SizeWE">
<Thumb.ToolTip>
<ToolTip Name="PART_RightToolTip" />
</Thumb.ToolTip>
</Thumb>
<RepeatButton Name="PART_RightEdge"/>
</StackPanel>
</ControlTemplate>
I added them as template parts to the RangeSlider control
TemplatePart(Name = "PART_LeftToolTip", Type = typeof(ToolTip)),
TemplatePart(Name = "PART_RightToolTip", Type = typeof(ToolTip))]
public sealed class RangeSlider : Control
In the OnApplyTemplate method I did the following
_leftPreviewToolTip = EnforceInstance<ToolTip>("PART_LeftToolTip");
_rightPreviewToolTip = EnforceInstance<ToolTip>("PART_RightToolTip");
Inside the InitializeVisualElements method I added the following
private void InitializeVisualElementsContainer()
{
// ** same as before ** //
_leftPreviewToolTip.PlacementTarget = _leftThumb;
_rightPreviewToolTip.PlacementTarget = _rightThumb;
}
Now for the fun parts, basically you want to display this tooltip when the thumbs are moved. For the left tooltip, you want it to show when the left thumb is moved or when the center thumb is moved. I created a method called, ShowLeftTooltip and call it from LeftThumbDragDelta and CenterThumbDragDelta respectively.
private void ShowLeftToolTip()
{
_leftPreviewToolTip.IsOpen = AutoToolTip;
// This is a little trick to cause the ToolTip to update its position next to the Thumb
_leftPreviewToolTip.HorizontalOffset = _leftPreviewToolTip.HorizontalOffset == 0.0 ? 0.001 : 0.0;
}
That tip to move the tooltip is not something I thought of, I got it from another post somewhere.
I'll leave it as an exercise to the reader to implement the right tooltip.
You can style the tooltip so this allows a flexible display. Don't forget to give the tooltip something as a data context so that it won't be blank.