diff --git a/CefSharp.Wpf.Example/Views/Main/MainView.xaml b/CefSharp.Wpf.Example/Views/Main/MainView.xaml index afb3b0585..30dbe508d 100644 --- a/CefSharp.Wpf.Example/Views/Main/MainView.xaml +++ b/CefSharp.Wpf.Example/Views/Main/MainView.xaml @@ -29,8 +29,9 @@ DockPanel.Dock="Right" Command="{Binding GoCommand}">Go + Text="{Binding AddressEditable, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" + GotKeyboardFocus="OnTextBoxGotKeyboardFocus" + GotMouseCapture="OnTextBoxGotMouseCapture"> diff --git a/CefSharp.Wpf.Example/Views/Main/MainView.xaml.cs b/CefSharp.Wpf.Example/Views/Main/MainView.xaml.cs index a34f4d323..5fc68dcec 100644 --- a/CefSharp.Wpf.Example/Views/Main/MainView.xaml.cs +++ b/CefSharp.Wpf.Example/Views/Main/MainView.xaml.cs @@ -1,4 +1,5 @@ using System.Windows.Controls; +using System.Windows.Input; namespace CefSharp.Wpf.Example.Views.Main { @@ -8,5 +9,17 @@ namespace CefSharp.Wpf.Example.Views.Main { InitializeComponent(); } + + private void OnTextBoxGotKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e) + { + var textBox = (TextBox) sender; + textBox.SelectAll(); + } + + private void OnTextBoxGotMouseCapture(object sender, MouseEventArgs e) + { + var textBox = (TextBox) sender; + textBox.SelectAll(); + } } }