문제

I have a window with an embedded Chromium view, and a button bound to the BrowseBack command. The button works, but if I press the backspace key, it triggers the BrowseBack command instead of letting the user delete text in a text box inside the Chromium WebView.

I thought if I could find the InputBindingCollection where the command was bound, I could remove it, but I don't know where the default binding is registered. I have no idea whether this behavior is a bug in Chromium or expected behavior, or if there is a way to let backspace have the normal effect when a text field is focused.

도움이 되었습니까?

해결책

I believe you can use ApplicationCommands.NotACommand to disable that input binding. This works for the standard WPF controls, and should work for that control as well. For example:

<WebView>
    <WebView.InputBindings>
        <KeyBinding Key="Backspace" Command="ApplicationCommands.NotACommand"/>
    </WebView.InputBindings>
</WebView>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top