Skip to content

Commit

Permalink
WPF - IWpfWebBrowser implement IInputElement
Browse files Browse the repository at this point in the history
Simplify setting Focus from View model as now possible to call Keyboard.Focus(IWpfWebBrowser);

Resolves #3546
  • Loading branch information
amaitland committed Jun 4, 2021
1 parent 3dc37b2 commit 7dfead3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CefSharp.Wpf.Example/ViewModels/BrowserTabViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ private void Go()
{
Address = AddressEditable;

Keyboard.Focus((IInputElement)WebBrowser);
Keyboard.Focus(WebBrowser);
}

public void LoadCustomRequestExample()
Expand Down
3 changes: 2 additions & 1 deletion CefSharp.Wpf/IWpfWebBrowser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

using System;
using System.Windows;
using System.Windows.Input;
using System.Windows.Threading;
using CefSharp.Enums;
Expand All @@ -15,7 +16,7 @@ namespace CefSharp.Wpf
/// and properties the <see cref="ChromiumWebBrowser" /> exposes.
/// </summary>
/// <seealso cref="CefSharp.IWebBrowser" />
public interface IWpfWebBrowser : IWebBrowser
public interface IWpfWebBrowser : IWebBrowser, IInputElement
{
/// <summary>
/// Navigates to the previous page in the browser history. Will automatically be enabled/disabled depending on the
Expand Down

0 comments on commit 7dfead3

Please sign in to comment.