void UpdateContent() { _ = MauiContext ?? throw new InvalidOperationException($"{nameof(MauiContext)} should have been set by base class."); AView platformView = WindowHandler.CreateRootViewFromContent(this, VirtualView); // This is used for cases where we are testing swapping out the page set on window if (PlatformViewUnderTest?.Parent is FakeActivityRootView farw) { var decorView = MauiContext.Context.GetActivity().Window.DecorView; PlatformViewUnderTest.RemoveFromParent(); platformView.LayoutParameters = new LinearLayoutCompat.LayoutParams(AViewGroup.LayoutParams.MatchParent, AViewGroup.LayoutParams.MatchParent); farw.AddView(platformView); } PlatformViewUnderTest = platformView; }