diff --git a/src/Uno.UI.RuntimeTests.Engine.Library/Engine/UI/UnitTestsControl.cs b/src/Uno.UI.RuntimeTests.Engine.Library/Engine/UI/UnitTestsControl.cs index 6c53545..b4639b3 100644 --- a/src/Uno.UI.RuntimeTests.Engine.Library/Engine/UI/UnitTestsControl.cs +++ b/src/Uno.UI.RuntimeTests.Engine.Library/Engine/UI/UnitTestsControl.cs @@ -100,7 +100,7 @@ public UnitTestsControl() GetContent: () => unitTestContentRoot.Content as UIElement, SetContent: elt => unitTestContentRoot.Content = elt ); - UnitTestsUIContentHelper.CurrentTestWindow = XamlWindow.Current; + UnitTestsUIContentHelper.CurrentTestWindow ??= XamlWindow.Current; DataContext = null; diff --git a/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/UIHelper.cs b/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/UIHelper.cs index 3605f55..ac2dcfa 100644 --- a/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/UIHelper.cs +++ b/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/UIHelper.cs @@ -193,7 +193,7 @@ public static async ValueTask ScreenShot(FrameworkElement element, b { case ScreenShotScalingMode.UsePhysicalPixelsWithImplicitScaling: await renderer.RenderAsync(element); - bitmap = await TestBitmap.From(renderer, element, DisplayInformation.GetForCurrentView()?.RawPixelsPerViewPixel ?? 1); + bitmap = await TestBitmap.From(renderer, element, element.XamlRoot?.RasterizationScale ?? 1); break; case ScreenShotScalingMode.UseLogicalPixels: await renderer.RenderAsync(element, (int)element.RenderSize.Width, (int)element.RenderSize.Height);