private void UpdateInnerHeight() { int innerHeight = 0; foreach (var child in mContainer.GetChildren()) { var childY = child.Y; var childH = child.Height; var bottom = childY + childH; if (bottom > innerHeight) { innerHeight = bottom; } } mScrollBar.Max = innerHeight; }