0

The RangeSlider widget in the WPF extended-toolkit RangeSlider uses doubles for the values of each of the two thumbs on the slider.

I am using the slider to specify a lower DateTime and an upper DateTime. To do this I have to bind to a property which represents the DateTime as doubles (essentialy DateTime.Ticks cast to double).

When hovering over the thumbs of the RangeSlider, the tooltip shown is the double value, but I want to instead show a human-readable date. I can do the conversion easily enough, but:

How do I get the RangeSlider to show custom text in the thumb tooltips?

A less appealing (but sufficient) alternative is to simply disable the thumb tooltips entirely. A solution for this alternative is also proving elusive.

For what it's worth, I've tried inspecting the code for RangeSlider.cs using JetBrains decompiler, but it hasn't yielded any promising leads to my untrained eye.

cdjc
  • 1,039
  • 12
  • 24

1 Answers1

0

The ToolTip you see is from the AutoToolTip of the Slider used in the RangeSlider's template.

Slider exposes AutoToolTipPlacement and AutoToolTipPrecision, but it does not expose a property to change the text displayed in the ToolTip.

However, I found an article that demonstrates a workaround that could allow you to achieve what you are looking for:

https://joshsmithonwpf.wordpress.com/2007/09/14/modifying-the-auto-tooltip-of-a-slider/

Diane-Xceed
  • 319
  • 1
  • 6
  • That's a useful link @diane-xceed, but RangeSlider doesn't expose the Slider objects for the lower and upper sliders. – cdjc Aug 31 '16 at 21:20