MainWindow.xaml - simplify static bindings
HoverLinkBehaviour - Always use BeginInvoke unless there's an explicit reason for using a sync action EnvironmentConverter - Minor inconsistencies
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
using CefSharp.Wpf;
|
||||
using System.Windows;
|
||||
using System.Windows.Interactivity;
|
||||
using System;
|
||||
|
||||
namespace CefSharp.MinimalExample.Wpf.Behaviours
|
||||
{
|
||||
public class HoverLinkBehaviour : Behavior<ChromiumWebBrowser>
|
||||
{
|
||||
// Using a DependencyProperty as the backing store for HoverLink. This enables animation, styling, binding, etc...
|
||||
// Using a DependencyProperty as the backing store for HoverLink. This enables animation, styling, binding, etc...
|
||||
public static readonly DependencyProperty HoverLinkProperty = DependencyProperty.Register("HoverLink", typeof(string), typeof(HoverLinkBehaviour), new PropertyMetadata(string.Empty));
|
||||
|
||||
public string HoverLink
|
||||
@@ -27,8 +28,8 @@ namespace CefSharp.MinimalExample.Wpf.Behaviours
|
||||
|
||||
private void OnStatusMessageChanged(object sender, StatusMessageEventArgs e)
|
||||
{
|
||||
var dp = sender as ChromiumWebBrowser;
|
||||
dp.Dispatcher.Invoke(() => HoverLink = e.Value);
|
||||
var chromiumWebBrowser = sender as ChromiumWebBrowser;
|
||||
chromiumWebBrowser.Dispatcher.BeginInvoke((Action)(() => HoverLink = e.Value));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user