From 16aa59d6aa2e8b374200da032e6ef307ca7dff6a Mon Sep 17 00:00:00 2001 From: amaitland Date: Sat, 23 May 2020 20:30:22 +1000 Subject: [PATCH] WPF - Add AddressChanged event Typically the address would be databound, there's been a few requests to add an event so adding one. --- CefSharp.Wpf/ChromiumWebBrowser.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CefSharp.Wpf/ChromiumWebBrowser.cs b/CefSharp.Wpf/ChromiumWebBrowser.cs index 2676857f8..619cf534b 100644 --- a/CefSharp.Wpf/ChromiumWebBrowser.cs +++ b/CefSharp.Wpf/ChromiumWebBrowser.cs @@ -800,6 +800,7 @@ namespace CefSharp.Wpf ConsoleMessage = null; FrameLoadEnd = null; FrameLoadStart = null; + AddressChanged = null; IsBrowserInitializedChanged = null; LoadError = null; LoadingStateChanged = null; @@ -1416,6 +1417,11 @@ namespace CefSharp.Wpf DependencyProperty.Register(nameof(Address), typeof(string), typeof(ChromiumWebBrowser), new UIPropertyMetadata(null, OnAddressChanged)); + /// + /// Event called when the browser address has changed + /// + public event DependencyPropertyChangedEventHandler AddressChanged; + /// /// Handles the event. /// @@ -1428,6 +1434,8 @@ namespace CefSharp.Wpf var newValue = (string)args.NewValue; owner.OnAddressChanged(oldValue, newValue); + + owner.AddressChanged?.Invoke(owner, args); } ///