Reputation: 1233
Does anybody know the ratio of ScrollToHorizontalOffset and ScrollToVerticalOffset to the window size? Is there a rule of thumb?
Given an X,Y I want to center the window on the X,Y, so what would the offsets be? No, this doesn't work:
scrollViewer.ScrollToHorizontalOffset(X);
scrollViewer.ScrollToVerticalOffset(Y);
Doing some tests it seemed like scrollViewer took about 28 steps to scroll a window that was 2,048 by 2,048.
Upvotes: 1
Views: 1553
Reputation: 8791
There is no such a thing like rule of thumb.
ScrollView.Extent is the complete size.
ScrollViewer.Viewport is the visible size.
ScrollViewer.VertiacalOffset is the current Y offset value.
ScrollViewer.HorizontalOffset is the current X offset value.
Upvotes: 2