public void InvalidateScrollInfo ()
{
if (ScrollInfo != null) {
ExtentHeight = ScrollInfo.ExtentHeight;
ExtentWidth = ScrollInfo.ExtentWidth;
ViewportHeight = ScrollInfo.ViewportHeight;
ViewportWidth = ScrollInfo.ViewportWidth;
UpdateScrollBar (Orientation.Horizontal, ScrollInfo.HorizontalOffset);
UpdateScrollBar (Orientation.Vertical, ScrollInfo.VerticalOffset);
UpdateScrollbarVisibility ();
}
// UIA Event
RaiseViewportChangedEvent (ViewportWidth, ViewportHeight);
if (Math.Max(0, ExtentHeight - ViewportHeight) != ScrollableHeight) {
SetValueImpl (ScrollableHeightProperty, Math.Max(0, ExtentHeight - ViewportHeight));
InvalidateMeasure ();
}
if (Math.Max(0, ExtentWidth - ViewportWidth) != ScrollableWidth) {
SetValueImpl (ScrollableWidthProperty, Math.Max(0, ExtentWidth - ViewportWidth));
InvalidateMeasure ();
}
}