private void HandleLayoutChange() { if (_nextLayout != null) { if (CurrentLayout != null) { CurrentLayout.End(); Singletons.OnLayoutEnded(); } CurrentLayout = _nextLayout; if (CurrentLayout != null) { CurrentLayout.Start(); Singletons.OnLayoutStarted(); } _nextLayout = null; } }