title: How to implement a navigation button in shared application resources?
body: <p>I'm currently trying to create a simple app that pulls data from an API I made and displays it in a list. You are then supposed to be able to click the list items to be navigated to a detailed view page with an image viewer etc. For that to work I need to navigate to a page called <code>PlanViewer.xaml</code> (currently only available for the Windows Phone app part, will do for both though).</p>
  
  <p>For my list to work I built the following data template in my shared <code>App.xaml</code>:</p>
  
  <pre><code>    &lt;DataTemplate x:Key="PlanDataTemplate"&gt;
          &lt;StackPanel Orientation="Horizontal"&gt;
              &lt;Button Name="NavigatePlan" Tag="{Binding FilePath}"&gt;
                  &lt;StackPanel&gt;
                      &lt;TextBlock Style="{StaticResource SubheaderTextBlockStyle}" Text="{Binding Name}" /&gt;
                      &lt;TextBlock Style="{StaticResource TitleTextBlockStyle}" Text="{Binding LastUpdate}" /&gt;
                  &lt;/StackPanel&gt;
              &lt;/Button&gt;
          &lt;/StackPanel&gt;
      &lt;/DataTemplate&gt;
  </code></pre>
  
  <p>I apply it in my <code>MainPage.xaml</code> as shown here:</p>
  
  <pre><code>&lt;ItemsControl x:Name="PlanList" ItemTemplate="{StaticResource PlanDataTemplate}" ItemsSource="{Binding PlanItems}" &gt;
      &lt;ItemsControl.ItemsPanel&gt;
          &lt;ItemsPanelTemplate&gt;
              &lt;VirtualizingStackPanel /&gt;
          &lt;/ItemsPanelTemplate&gt;
      &lt;/ItemsControl.ItemsPanel&gt;
  &lt;/ItemsControl&gt;
  </code></pre>
  
  <p>I can't bind any events to the button in the <code>App.xaml</code>, so I think I need to use an <code>ICommand</code> interface. I might also have a much more fundamental mistake in how I built this thing so far. </p>
  
  <p>TL;DR for my goal: I want to adjust the datatemplate so that every button links to a page <code>PlanViewer.xaml</code> with an argument describing which plan is supposed to be shown (e.g. ID or file path).</p>