Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2092
Styling the Thumbs in XamNumericRangeSlider
posted

I have the XamNumericRangeSlider and I'm trying to style the thumbs so that I would have a DomainUpDown-control with the thumb value (found in SL Toolkit)? Can you think of any way this would be possible? I haven't succeeded in it yet. 

Here's my code (style has bunch of other things as well but this is the part that matters)

<Style x:Key="CustomThumbStyle" TargetType="ig:XamSliderThumbBase">
  <Setter Property="Template">
    <Setter.Value>
      <ControlTemplate TargetType="ig:XamSliderThumbBase">
        <Grid>
        <toolkit:DomainUpDown Value="{Binding MyValueProperty, Mode=TwoWay}" ItemsSource="{Binding ValueList, Mode=TwoWay}"></toolkit:DomainUpDown>
        </Grid>
      </ControlTemplate>
    </Setter.Value>
  </Setter>
</Style>

I have binded the thumb ValueProperty to "MyValueProperty" and I also try to display it in the DomainUpDown. If I set the DomainUpDown values, the value is updated in my property but if I drag the thumb, the values are not updated to the DomainUpDown-control. 

If you could test this scenario and try to see if you can get it working?

  • 2092
    Verified Answer
    posted

    I got it! It wasn't working because the ValueList was a string list and the thumb value is double. I needed to match the types with a converter and now it works like a charm. No need to investigate this any further.