title: Using F1 Help (CHM format) With WPF
body: <p>I've been working on a WPF application for a while, and the time has come to attach the CHM format help document to it.</p>
  
  <p>But alas! HelpProvider, the standard way to show CHM files in Winforms, has magically vanished and has no counterpart in WPF. I've been trying to use WindowsFormsHost to spawn a new control so I can actually display the help, but essentially it just grabs control of the entire UI.</p>
  
  <p>A little more detail: I've got a menu item that I want to, when clicked, open up the CHM file.</p>
  
  <p>First I set up the WindowsFormsHost...</p>
  
  <pre><code>host = new System.Windows.Forms.Integration.WindowsFormsHost();
  helpForm = new System.Windows.Forms.Control();
  host.Child = helpForm;
  host.Visibility = System.Windows.Visibility.Hidden;
  this.grid1.Children.Add(host);
  
  hp = new System.Windows.Forms.HelpProvider();
  hp.HelpNamespace = "Somehelpfile.chm";
  hp.SetHelpNavigator(helpForm, System.Windows.Forms.HelpNavigator.TableOfContents);
  </code></pre>
  
  <p>And then I say, voila, reveal yourself.</p>
  
  <pre><code>private void Help_Click(object sender, RoutedEventArgs e)
  {
      host.Visibility = Visibility.Visible;
      helpForm.Show();
      hp.SetShowHelp(helpForm, true);
  }  
  </code></pre>
  
  <p>I'm not really sure of where to proceed from here. When I show the helpForm, it obscures / overrides the existing UI and all I get is a gray, empty WPF window with no help file. </p>
  
  <p>Any takers? </p>