diff --git a/src/Uno.UI.Runtime.Skia.Wpf/UI/Controls/WpfWindowWrapper.cs b/src/Uno.UI.Runtime.Skia.Wpf/UI/Controls/WpfWindowWrapper.cs index fb7a304d5771..e8d51e8536b3 100644 --- a/src/Uno.UI.Runtime.Skia.Wpf/UI/Controls/WpfWindowWrapper.cs +++ b/src/Uno.UI.Runtime.Skia.Wpf/UI/Controls/WpfWindowWrapper.cs @@ -32,9 +32,12 @@ public WpfWindowWrapper(UnoWpfWindow wpfWindow, WinUIWindow window, XamlRoot xam _wpfWindow.DpiChanged += OnNativeDpiChanged; _wpfWindow.StateChanged += OnNativeStateChanged; _wpfWindow.Host.SizeChanged += (_, e) => OnHostSizeChanged(e.NewSize); - OnHostSizeChanged(new Size(_wpfWindow.Width, _wpfWindow.Height)); _wpfWindow.LocationChanged += OnNativeLocationChanged; _wpfWindow.SizeChanged += OnNativeSizeChanged; + + RasterizationScale = (float)VisualTreeHelper.GetDpi(_wpfWindow.Host).DpiScaleX; + + OnHostSizeChanged(new Size(_wpfWindow.Width, _wpfWindow.Height)); UpdateSizeFromNative(); UpdatePositionFromNative(); } @@ -72,7 +75,6 @@ public override string Title protected override void ShowCore() { - RasterizationScale = (float)VisualTreeHelper.GetDpi(_wpfWindow.Host).DpiScaleX; _wpfWindow.Show(); _wasShown = true; UpdatePositionFromNative();