mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-04 19:25:01 +00:00
WPF - Add AddressChanged event
Typically the address would be databound, there's been a few requests to add an event so adding one.
This commit is contained in:
@@ -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));
|
||||
|
||||
/// <summary>
|
||||
/// Event called when the browser address has changed
|
||||
/// </summary>
|
||||
public event DependencyPropertyChangedEventHandler AddressChanged;
|
||||
|
||||
/// <summary>
|
||||
/// Handles the <see cref="E:AddressChanged" /> event.
|
||||
/// </summary>
|
||||
@@ -1428,6 +1434,8 @@ namespace CefSharp.Wpf
|
||||
var newValue = (string)args.NewValue;
|
||||
|
||||
owner.OnAddressChanged(oldValue, newValue);
|
||||
|
||||
owner.AddressChanged?.Invoke(owner, args);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user