Skip to content

Commit

Permalink
* WPF - Add OnDpiChanged for NetCore builds
Browse files Browse the repository at this point in the history
Automatically deals with DPI Change

Issue #3388
  • Loading branch information
amaitland committed Mar 16, 2021
1 parent 03446d4 commit e78e18f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions CefSharp.Wpf/ChromiumWebBrowser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1758,6 +1758,16 @@ protected virtual Point GetBrowserScreenLocation()
}
}

#if NETCOREAPP
/// <inheritdoc/>
protected override void OnDpiChanged(DpiScale oldDpi, DpiScale newDpi)
{
NotifyDpiChange((float)newDpi.DpiScaleX);

base.OnDpiChanged(oldDpi, newDpi);
}
#endif

private void OnWindowLocationChanged(object sender, EventArgs e)
{
//We maintain a manual reference to the controls screen location
Expand Down

0 comments on commit e78e18f

Please sign in to comment.