1) Added Hover Link, ChromiumVersion, CefVersion, CefSharpVersion, ProcessInfo in Status Bar. 2) Added Back, Forward, Print and View source buttons and Addressbar. (#36)
Add Primary Navigation/Address Bar and Status bar
This commit is contained in:
committed by
Alex Maitland
parent
75ccd029e0
commit
63d6b44f35
34
CefSharp.MinimalExample.Wpf/Behaviours/HoverLinkBehaviour.cs
Normal file
34
CefSharp.MinimalExample.Wpf/Behaviours/HoverLinkBehaviour.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using CefSharp.Wpf;
|
||||
using System.Windows;
|
||||
using System.Windows.Interactivity;
|
||||
|
||||
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...
|
||||
public static readonly DependencyProperty HoverLinkProperty = DependencyProperty.Register("HoverLink", typeof(string), typeof(HoverLinkBehaviour), new PropertyMetadata(string.Empty));
|
||||
|
||||
public string HoverLink
|
||||
{
|
||||
get { return (string)GetValue(HoverLinkProperty); }
|
||||
set { SetValue(HoverLinkProperty, value); }
|
||||
}
|
||||
|
||||
protected override void OnAttached()
|
||||
{
|
||||
AssociatedObject.StatusMessage += OnStatusMessageChanged;
|
||||
}
|
||||
|
||||
protected override void OnDetaching()
|
||||
{
|
||||
AssociatedObject.StatusMessage -= OnStatusMessageChanged;
|
||||
}
|
||||
|
||||
private void OnStatusMessageChanged(object sender, StatusMessageEventArgs e)
|
||||
{
|
||||
var dp = sender as ChromiumWebBrowser;
|
||||
dp.Dispatcher.Invoke(() => HoverLink = e.Value);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user