protected override void OnSizeAllocated(double width, double height) { base.OnSizeAllocated(width, height); if (_width != width || _height != height) { _width = width; _height = height; var newOrientation = ViewHelper.DetermineOrientation(width, height); if (_cityDetailsViewShowing && newOrientation == StackOrientation.Horizontal) { CloseCityDetailsView(); } if (_initialized && _orientation != newOrientation) { _orientation = newOrientation; SetupLayout(_orientation); } } }
protected override async void OnSizeAllocated(double width, double height) { base.OnSizeAllocated(width, height); if (Math.Abs(_width - width) > 0.1 || Math.Abs(_height - height) > 0.1) { _width = width; _height = height; var newOrientation = ViewHelper.DetermineOrientation(width, height); if (_cityDetailsViewShowing && newOrientation == StackOrientation.Horizontal) { await CloseCityDetailsView(); } if (_initialized && _orientation != newOrientation) { _orientation = newOrientation; SetupLayout(_orientation); } } }