title: Using a Button to navigate to another Page in a NavigationWindow
body: <p>I'm trying to use the navigation command framework in WPF to navigate between Pages within a WPF application (desktop; not XBAP or Silverlight).</p>
  
  <p>I believe I have everything configured correctly, yet its not working.  I build and run without errors, I'm not getting any binding errors in the Output window, but my navigation button is disabled.</p>
  
  <p>Here's the app.xaml for a sample app:</p>
  
  <pre><code>&lt;Application x:Class="Navigation.App"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      StartupUri="First.xaml"&gt;
  &lt;/Application&gt;
  </code></pre>
  
  <p>Note the StartupUri points to First.xaml.  First.xaml is a Page.  WPF automatically hosts my page in a NavigationWindow.  Here's First.xaml:</p>
  
  <pre><code>&lt;Page x:Class="Navigation.First"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      Title="First"&gt;
      &lt;Grid&gt;
          &lt;Button 
              CommandParameter="/Second.xaml" 
              CommandTarget="{Binding RelativeSource=
                  {RelativeSource 
                      FindAncestor, 
                      AncestorType={x:Type NavigationWindow}}}" 
              Command="NavigationCommands.GoToPage" 
              Content="Go!"/&gt;
      &lt;/Grid&gt;
  &lt;/Page&gt;
  </code></pre>
  
  <p>The button's CommandTarget is set to the NavigationWindow.  The command is GoToPage, and the page is /Second.xaml.  I've tried setting the CommandTarget to the containing Page, the CommandParameter to "Second.xaml" (First.xaml and Second.xaml are both in the root of the solution), and I've tried leaving the CommandTarget empty.  I've also tried setting the Path to the Binding to various navigational-related public properties on the NavigationWindow.  Nothing has worked so far.</p>
  
  <p>What am I missing here?  I <em>really</em> don't want to do my navigation in code.</p>
  
  <hr>
  
  <p>Clarification.</p>
  
  <p>If, instead of using a button, I use a Hyperlink:</p>
  
  <pre><code>&lt;Grid&gt;
      &lt;TextBlock&gt;
         &lt;Hyperlink 
             NavigateUri="Second.xaml"&gt;Go!
         &lt;/Hyperlink&gt;
      &lt;/TextBlock&gt;
  &lt;/Grid&gt;
  </code></pre>
  
  <p>everything works as expected.  However, my UI requirements means that using a Hyperlink is right out.  I need a big fatty button for people to press.  That's why I want to use the button to navigate.  I just want to know how I can get the Button to provide the same ability that the Hyperlink does in this case.</p>