As I need to display long text strings in one of my WP7 project, I added Alex Yakhnin’s ScrollableTextBlock control to it.
It’s working as expected, but I need to scroll the textblock automatically on certain user interaction, but the control doesn’t support ScrollToVerticalOffset out of the box and I have no idea how to go about it.
I guess removing the element and adding new one would do it, but I think that’s doing bit too much for such a simple task.
One kind of ugly workaround is to add a Load-event to the ScrollViewer. When the event fires, fetch the sender (which is the ScrollViewer, duh!) and store it in a class-level variable. This way you have access to it in other methods and you can use the ScrollToVerticalOffset-method.
XAML
C#
I know it’s probably not the nicest solution but it works. Hope this helps!