WPF Slider tick label:
I'm looking for some way to place labels along with the Slider Ticks. I dont think there is a straight way to do this. Not sure why Microsoft has not provided this basic feature.
How can I achieve this in WPF maybe using a dependency property.
The below slider code sample shows time interval, 1, 3, 6, 12, 24. I want these numbers to appear above/below the ticks. if I place a label binding to the slider element as shown in the code snippet, the values appear end of the slider all packed together as comma separated values.
Any other way to have the labels appear along the ticks. I want this in WPF way, maybe overriding a dependency property, not in the code behind.
<Slider Name="ServiceTime"
Minimum="1"
Maximum="24"
Value="{Binding TimeInterval}"
TickPlacement="BottomRight"
IsSnapToTickEnabled="True"
Ticks ="{Binding TimeIntervalList}"
MinWidth="450"/>
<Label Content="{Binding ElementName=ServiceTime, Path=Value}"
VerticalAlignment="Center" Width="100" />