From 24bc2cd73906f8ff483b5a000804fcbaf0a368f2 Mon Sep 17 00:00:00 2001 From: Giuseppe Lippolis Date: Fri, 8 Jul 2022 11:12:15 +0200 Subject: [PATCH] fix(RenderTargetBitmap): Compilation error after merge PR #8612 --- src/Uno.UI/UI/Xaml/Media/Imaging/RenderTargetBitmap.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Uno.UI/UI/Xaml/Media/Imaging/RenderTargetBitmap.cs b/src/Uno.UI/UI/Xaml/Media/Imaging/RenderTargetBitmap.cs index 3bbbcfb68565..88562e5a5945 100644 --- a/src/Uno.UI/UI/Xaml/Media/Imaging/RenderTargetBitmap.cs +++ b/src/Uno.UI/UI/Xaml/Media/Imaging/RenderTargetBitmap.cs @@ -88,9 +88,7 @@ public IAsyncAction RenderAsync(UIElement? element, int scaledWidth, int scaledH try { UIElement elementToRender = element - ?? XamlRoot.Current.Content - ?? throw new global::System.NullReferenceException("Invalid XamlRoot Content."); - + ?? Window.Current.Content; (_bufferSize, PixelWidth, PixelHeight) = RenderAsBgra8_Premul(elementToRender, ref _buffer, new Size(scaledWidth, scaledHeight)); #if __WASM__ || __SKIA__ InvalidateSource(); @@ -111,8 +109,7 @@ public IAsyncAction RenderAsync(UIElement? element) try { UIElement elementToRender = element - ?? XamlRoot.Current.Content - ?? throw new global::System.NullReferenceException("Invalid XamlRoot Content."); + ?? Window.Current.Content; (_bufferSize, PixelWidth, PixelHeight) = RenderAsBgra8_Premul(elementToRender, ref _buffer); #if __WASM__ || __SKIA__