I am trying to make a range control which is basically a slider control with an extra thumb. The only code I found for one already built is here.
http://www.codeplex.com/AvalonControlsLib
For the life of me I cannot get a tooltip to show up above each thumb (with the current value) while it is being moved. It will show a short mouse hover tooltip, but it disappears when the thumb is being moved. Does anyone know anything about this particular control, or how you would add a second thumb to the slider control and use it the same way? I’ve found this basic question on a few forums with no answer besides pointing to the above link. Of course, people always mention how easy it is without showing or explaining how you would go about it. Thanks in advance.
Bob
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
I added them as template parts to the RangeSlider control
In the OnApplyTemplate method I did the following
Inside the InitializeVisualElements method I added the following
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.
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.