public void ChangeWindow(Window newWindow) { if (_toplevel == null) { var errorMessage = "Couldn't change window. TopLevel view doesn't exist."; _logger.Fatal(errorMessage); throw new InvalidOperationException(errorMessage); } _toplevel.RemoveAll(); _toplevel.Add(newWindow); _currentWindow = newWindow; _toplevel.LayoutSubviews(); _toplevel.FocusFirst(); }