Added CalculateLayout method to View.