title: Remove button highlight from hosted wpf browser application
body: <p>The issue is:</p>
  
  <p>When hosting this minimally functional code, on navigating or refreshing the page the first button on the form is highlighted with a blue inner border. Removing the border from the control removes the inner border altogether, however <strong>we require a border to be on the control</strong>.</p>
  
  <p>Okay, this is going to be a doozy, so I'm going to post the entire minimally functional code for two projects, one MVC and one WPF...</p>
  
  <h2>Project 1 - MVC</h2>
  
  <p><strong>~/Views/Shared/_Layout.cshtml</strong></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;meta http-equiv="X-UA-Compatible" content="IE=Edge" /&gt;
          &lt;style&gt;
              .scrollUp, .scrollDown {
                  width: 110px;
                  height: 110px;
                  background-color: black;
                  border-radius: 55px;
                  color: white;
                  font-size: 1.6em;
                  background: linear-gradient(120deg, #404040, black);
              }
          &lt;/style&gt;
  
      &lt;/head&gt;
      &lt;body&gt;
          @RenderBody()
          @RenderSection("footer", false)
  
          &lt;button class="scrollUp"&gt;Page&lt;br /&gt;Up&lt;/button&gt;
          &lt;button class="scrollDown"&gt;Page Down&lt;/button&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>~/Views/Home/Index.cshtml</strong></p>
  
  <pre><code>@{
  
      ViewBag.Title = "Kiosk Online Ordering";
  }
  
  Birds
  </code></pre>
  
  <p><strong>~/Controllers/Home/HomeController.cs</strong></p>
  
  <pre><code>using System.Web.Mvc;
  namespace Kiosk.Web.Controllers
  {
      public class HomeController : Controller
      {
          public ViewResult Index()
          {
              return View();
          }
      }
  }
  </code></pre>
  
  <h2>Project 2 - WPF Host</h2>
  
  <p><strong>Views/MainWindowView.xaml</strong> </p>
  
  <pre><code>&lt;Window x:Class="Store.Kiosk.Views.MainWindowView"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
          xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
          xmlns:viewModels="clr-namespace:Store.Kiosk.ViewModels"
          mc:Ignorable="d"
          Title="MainWindow" Height="1024" Width="1280" d:DataContext="{d:DesignInstance viewModels:DesignKioskWebBrowserViewModel, IsDesignTimeCreatable=True}"
          ResizeMode="NoResize" WindowStyle="None" WindowStartupLocation="CenterScreen"&gt;
      &lt;ContentControl Content="{Binding WebBrowserControl}"/&gt;
  &lt;/Window&gt;
  </code></pre>
  
  <p><strong>Views/MainWindowView.xaml.cs</strong></p>
  
  <pre><code>using System;
  using System.Windows;
  using System.Windows.Controls;
  using Store.Kiosk.Services;
  using Store.Kiosk.ViewModels;
  
  namespace Store.Kiosk.Views
  {
      /// &lt;summary&gt;
      /// Interaction logic for MainWindow.xaml
      /// &lt;/summary&gt;
      public partial class MainWindowView : Window
      {
          private IWebKioskConfigurationService _webKioskConfigurationService;
  
          public MainWindowView()
          {
              _webKioskConfigurationService = new WebKioskConfigurationService();
              //_webKioskConfigurationService = webKioskConfigurationService;
  
              DataContext = new KioskWebBrowserViewModel
              {
                  WebBrowserControl = new WebBrowser { Source = _webKioskConfigurationService.GetDefaultUri() }
              };
              InitializeComponent();
          }
      }
  }
  </code></pre>
  
  <p><strong>ViewModels/DesignKioskWebBrowserViewModel.cs</strong></p>
  
  <pre><code>using System;
  using System.Windows.Controls;
  
  namespace KK.Store.Kiosk.Standalone.ViewModels
  {
  // ReSharper disable ClassNeverInstantiated.Global
      public class DesignKioskWebBrowserViewModel : KioskWebBrowserViewModel
  // ReSharper restore ClassNeverInstantiated.Global
      {
          public DesignKioskWebBrowserViewModel()
          {
              WebBrowserControl = new WebBrowser { Source = new Uri("http://www.google.com", UriKind.Absolute) };
          }
      }
  }
  </code></pre>
  
  <p><strong>ViewModels/KioskWebBrowserViewModel.cs</strong></p>
  
  <pre><code>using System;
  using System.Windows.Controls;
  using Store.Kiosk.ViewModels;
  
  namespace Store.Kiosk.ViewModels
  {
      public class KioskWebBrowserViewModel : ViewModelBase
      {
          public KioskWebBrowserViewModel()
          {
          }
          private WebBrowser _webBrowserControl;
  
          public WebBrowser WebBrowserControl
          {
              get { return _webBrowserControl; }
              set { SetValue(ref _webBrowserControl, value); }
          }
      }
  }
  </code></pre>
  
  <p><strong>ViewModels/ViewModelBase.cs</strong></p>
  
  <pre><code>using System;
  using System.ComponentModel;
  using System.Runtime.CompilerServices;
  
  namespace Store.Kiosk.ViewModels
  {
      public abstract class ViewModelBase : INotifyPropertyChanged, IDisposable
      {
          public event PropertyChangedEventHandler PropertyChanged;
          private bool _isVisible = true;
  
          public bool IsVisible
          {
              get { return _isVisible; }
              set { SetValue(ref _isVisible, value); }
          }
  
  
          [STAThread]
          public void Dispose()
          {
              Dispose(true);
              GC.SuppressFinalize(this);
          }
  
          [STAThread]
          ~ViewModelBase()
          {
              Dispose(false);
          }
  
          protected virtual void Dispose(bool disposing)
          {
          }
  
          protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
          {
              var handler = PropertyChanged;
              if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));
          }
  
          protected void SetValue&lt;T&gt;(ref T field, T value, [CallerMemberName] string propertyName = null)
          {
              if (Equals(value, field)) return;
  
              field = value;
  
              OnPropertyChanged(propertyName);
          }
      }
  }
  </code></pre>
  
  <p><strong>Services/IWebKioskConfigurationService.cs</strong></p>
  
  <pre><code>using System;
  
  namespace Store.Kiosk.Services
  {
      public interface IWebKioskConfigurationService
      {
          Uri GetDefaultUri();
      }
  }
  </code></pre>
  
  <p><strong>Services/WebKioskConfigurationService.cs</strong></p>
  
  <pre><code>using System;
  
  namespace Store.Kiosk.Services
  {
      public class WebKioskConfigurationService : IWebKioskConfigurationService
      {
          public Uri GetDefaultUri()
          {
              return new Uri("http://localhost/{YourKioskWebsiteUrl}", UriKind.Absolute);
          }
      }
  }
  </code></pre>
  
  <p>So, if you have installed IE9+ without compatibility mode, this should result in two buttons, one having a blue inner border. I've tried removing the border from :hover, :active, :focus, ::-moz-focus-inner and none of them appear to work. As soon as I re-add the border to the button, the blue inner border returns. Is anyone out there familiar enough to help with this issue?</p>
  
  <p>I'm running IE11</p>