locked
Programmatically scrolling a ScrollViewer from Xaml

    Question

  • Is there a way to set this in Xaml?  i.e. I have a slider and I want the slider to control the vertical offset of the scroll viewer.

    For example, I can do this in a poor man's scroll viewer... but this doesn't scale all the time:

                                        <GridView.RenderTransform>
                                            <TranslateTransform Y="{Binding ElementName=c_slider, Path=Value}" />
                                        </GridView.RenderTransform>
    


    nagendra mishr

    Wednesday, June 25, 2014 8:07 PM

Answers

  • No, you can't bind to the ScrollViewer's position. The only way to set it is through code (ChangeView or ScrollToVerticalOffset).

    You could set up a behavior to call one of these functions from Xaml.

    --Rob

    Wednesday, June 25, 2014 8:47 PM
    Owner