I currently have two ScrollViewer's containing alternate views of the same collection. I have bound the scrolling of the two scrollviewers together by handling the ScrollChanged event and using ScrollToVerticalOffset.
For presentation reasons I have set both ScrollViewer scrollbars to hidden and want to control them both from a seperate ScrollBar.
This seems to not be straightforward. I recall seeing a blog about it a few months ago but I can't find it again.
Can anyone point me in the direction of some useful resources or give me a shove in the right direction to how it might be achieved.
Thanks in advance.
Ok, solved this. Was actually quite straightforward.
Have since found Wpf binding to a function, which should help anyone else interested. Its VB but should be clear enough.
Cheers
Further to above: I subclassed ScrollBar and passed in the ScrollViewer I wanted to bind. Seems to work ok.
Great, just what I needed. I extended a bit so that the scrollviewer can be set from xaml as well using a dependency property. In xaml:
Code: