Skip to content

Commit 3f285d5

Browse files
joaompnevesamaitland
authored andcommitted
WPF - Ensure ZoomLevelProperty is updated on UI thread when Visibility Changed
1 parent 4163c8c commit 3f285d5

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

CefSharp.Wpf/ChromiumWebBrowser.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2015,11 +2015,13 @@ await CefUiThreadRunAsync(async () =>
20152015
//properly
20162016
var zoomLevel = await browser.GetHost().GetZoomLevelAsync();
20172017

2018-
if (!IsDisposed)
2018+
UiThreadRunAsync(() =>
20192019
{
2020-
SetCurrentValue(ZoomLevelProperty, zoomLevel);
2021-
}
2022-
2020+
if (!IsDisposed)
2021+
{
2022+
SetCurrentValue(ZoomLevelProperty, zoomLevel);
2023+
}
2024+
});
20232025
}
20242026
}
20252027
}

0 commit comments

Comments
 (0)