I wish to customize the appearance of the basic WPF TickBar. I was wondering if there was a simple way to do this using a control template:
I wish to have numbers i
Here are 2 fast and easy solutions that do the job but should not be considered best practices:
A super fast fix would be to set the AutoToolTipPlacemant property on the slider to TopRight. This means numbers will show up in a tooltip when you drag the slider.
Option 2 is to edit a copy of the control template
and just create a few TextBlock
s with your values in. This method is incredibly ramshackle and you should only use it if you want to use the special slider once. Also the numbers wont update if you change the Maximum and Minimum properties on the slider.
There is a proper way of solving this problem but if you need it done quickly and can't be bothered to start overriding OnRender or making a whole new control these ways will get the job done more quickly.
(the author of this answer post does in no way indorse sleazy coding practices or use these techniques as a substitute for the proper way of doing it in his software: they are just quick fixes) :-)