Skip to content

Commit

Permalink
Merge pull request #171 from unoplatform/dev/dr/unoSupport
Browse files Browse the repository at this point in the history
fix: Ensure valid XamlRoot
  • Loading branch information
dr1rrb committed Mar 5, 2024
2 parents 614333d + 1dfb268 commit 08becaa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ private TestBitmap(RenderTargetBitmap bitmap, UIElement renderedElement, double
/// </summary>
internal static async Task<TestBitmap> 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();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 08becaa

Please sign in to comment.