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:
Nikhil Agrawal
2017-04-10 05:45:55 +05:30
committed by Alex Maitland
parent 75ccd029e0
commit 63d6b44f35
7 changed files with 136 additions and 16 deletions

View 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);
}
}
}