How to get max scrollview offset in wp7?

I managed to get and install scrollerOffest as:

double horizonatalOffest = sv.HorizontalOffset; Debug.WriteLine("horizonlat offset: " + horizonatalOffest.ToString()); sv.ScrollToHorizontalOffset(2000); 

The problem is how to get the maximum offset. Let's say I have a scroller from 0 to 50,000. So how can I get the maximum offset? Scrollview.HorizontalOffset returns current offset position? Please note that my scroller grows / shrinks at runtime.

+4
source share
1 answer

The maximum offset for the ScrollViewer will depend on its contents. Get the child of the ScrollViewer and get its height through the ActualHeight property. Then we subtract the value of the ScrollViewer ActualHeight to give you the maximum offset.

+1
source

All Articles