Note: Starting with Chromium 52, backspace navigation is disabled in the browser engine. This means backspace navigation is no longer available since DotNetBrowser 1.10.


By default navigation on Backspace and Shift+Backspace is enabled. In order to disable navigation when user presses Backspace or Shift+Backspace use the following approach:


MainWindow.xaml

<Window x:Class="WPF.BackspaceNavigation.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525" >
    <Grid Name="mainLayout">
        
    </Grid>
</Window>


С#

MainWindow.xaml.cs

using System;
using System.IO;
using DotNetBrowser;
using DotNetBrowser.WPF;
using System.Windows;

namespace WPF.BackspaceNavigation
{
    public partial class MainWindow : Window
    {
        Browser browser;
        WPFBrowserView browserView;

        public MainWindow()
        {
            InitializeComponent();

            browser = BrowserFactory.Create();
            browserView = new WPFBrowserView(browser);
            mainLayout.Children.Add(browserView);

            browser.LoadHandler = new SampleLoadHandler();

            browserView.Browser.LoadURL("http://www.google.com");
        }
    }


    class SampleLoadHandler : LoadHandler
    {
        public override bool CanNavigateOnBackspace() {
            return false;
        }
    }
}


VB.NET

MainWindow.xaml.vb

Imports DotNetBrowser
Imports DotNetBrowser.WPF

Namespace WPF.BackspaceNavigation
    Class MainWindow
        Dim browser As Browser
        Dim browserView As WPFBrowserView

        Public Sub New()
            InitializeComponent()
            browser = BrowserFactory.Create()
            browserView = New WPFBrowserView(browser)
            mainLayout.Children.Add(browserView)
            browser.LoadHandler = New SampleLoadHandler()
            browserView.Browser.LoadURL("http://www.google.com")
        End Sub
    End Class

    Class SampleLoadHandler
        Inherits DefaultLoadHandler

        Public Overrides Function CanNavigateOnBackspace() As Boolean
            Return False
        End Function
    End Class
End Namespace