515a652685
1. Made more space for links hover in statusbar - Moved Progress Bar below addressbar. a) Thinly visible when loading, hides when loaded. b) No flickering as progress bar and browser share same row. 2. Behaviour to load page when hit Enter in Addressbar - Behaviour for that. 2. Refactor.
29 lines
770 B
C#
29 lines
770 B
C#
using System.Windows.Interactivity;
|
|
using System.Windows.Controls;
|
|
using System.Windows.Input;
|
|
|
|
namespace CefSharp.MinimalExample.Wpf.Behaviours
|
|
{
|
|
public class TextBoxBindingUpdateOnEnterBehaviour : Behavior<TextBox>
|
|
{
|
|
protected override void OnAttached()
|
|
{
|
|
AssociatedObject.KeyDown += OnTextBoxKeyDown;
|
|
}
|
|
|
|
protected override void OnDetaching()
|
|
{
|
|
AssociatedObject.KeyDown -= OnTextBoxKeyDown;
|
|
}
|
|
|
|
private void OnTextBoxKeyDown(object sender, KeyEventArgs e)
|
|
{
|
|
if (e.Key == Key.Enter)
|
|
{
|
|
var txtBox = sender as TextBox;
|
|
txtBox.GetBindingExpression(TextBox.TextProperty).UpdateSource();
|
|
}
|
|
}
|
|
}
|
|
}
|