diff --git a/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/TestBitmap.cs b/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/TestBitmap.cs index b4fb444..20a4039 100644 --- a/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/TestBitmap.cs +++ b/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/TestBitmap.cs @@ -51,7 +51,7 @@ private TestBitmap(RenderTargetBitmap bitmap, UIElement renderedElement, double /// internal static async Task From(RenderTargetBitmap bitmap, UIElement renderedElement, double? implicitScaling = null) { - implicitScaling ??= DisplayInformation.GetForCurrentView()?.RawPixelsPerViewPixel ?? 1; + implicitScaling ??= renderedElement.XamlRoot?.RasterizationScale ?? 1; var raw = new TestBitmap(bitmap, renderedElement, implicitScaling.Value); await raw.Populate(); 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 0fcc20e..540abc4 100644 --- a/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/UIHelper.cs +++ b/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/UIHelper.cs @@ -249,6 +249,7 @@ public static async ValueTask Show(TestBitmap bitmap, CancellationToken ct = def StackPanel legend; var popup = new ContentDialog { + XamlRoot = UnitTestsUIContentHelper.CurrentTestWindow?.Content?.XamlRoot, MinWidth = bitmap.Width + 2, MinHeight = bitmap.Height + 30, Content = new Grid