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
75
XamNumericRangeSlider inside datatemplate with IsSnapToTickEnabled="True" bindings does not work
posted

I have this data template:

<DataTemplate DataType="{x:Type SomeModel}">

<StackPanel Grid.Column="1">
                    <ig:XamNumericRangeSlider Grid.Column="1" MinValue="-5" MaxValue="100" Margin="6"
                                          VerticalAlignment="Bottom" IncreaseButtonVisibility="Collapsed"
                                          DecreaseButtonVisibility="Collapsed"
                                          TrackClickAction="MoveToPoint" IsMouseWheelEnabled="True">
                        <ig:XamSliderNumericThumb TrackFillBrush="Green" Value="{Binding ElementName=test, Path=Content, Mode=TwoWay}" IsSnapToTickEnabled="True"/>

                        <ig:XamNumericRangeSlider.TickMarks>
                            <ig:SliderTickMarks TickMarksFrequency="5" />
                        </ig:XamNumericRangeSlider.TickMarks>
                    </ig:XamNumericRangeSlider>

                    <Label x:Name="test"/>                    
                </StackPanel>

</DataTemplate>

I have a items control:

<ItemsControl Grid.Row="1" Grid.ColumnSpan="2" ItemsSource="{Binding SomeModel}"/>

The binding in the data template for the XamNumericRangeSlider does not work, if I make IsSnapToTickEnabled="false", it works with out any issues.

Please let me know how to make the binding work when IsSnapToTickEnabled="true"


Parents
No Data
Reply
  • 27093
    posted

    Hello Arun, 

    I have been looking into this for you I created a test sample according to your description (XamSliderTest.zip)  and everything seems to be working properly. I was wondering, if you’re having any binding errors in your Output window and/or the values you have bound are not all within the TickMarksFrequency’s range so they get snapped to the closest one and seem to be not working.  

    Looking forward to hearing from you.

    XamSliderTest.zip
Children