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 7950640 commit 207172e
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 @@ -1637,6 +1637,16 @@ private void PresentationSourceChangedHandler(object sender, SourceChangedEventA
}
}

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

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

private void OnWindowStateChanged(object sender, EventArgs e)
{
var window = (Window)sender;
Expand Down

0 comments on commit 207172e

Please sign in to comment.