title: Application bar in windows phone 7
body: <p>I am trying to create a application bar in my windows phone 7 application.
  But i think there is some problem with the click event because sometimes it works and sometimes it does not work.</p>
  
  <p>Below is the code in <code>xaml</code> and <code>.cs</code> .</p>
  
  <p><strong>xaml</strong></p>
  
  <p></p>
  
  <pre><code>    &lt;shell:ApplicationBar IsVisible="True" IsMenuEnabled="False"&gt;
          &lt;shell:ApplicationBarIconButton IconUri="/Icons/appbar.edit.rest.png" Text="Edit" Click="btnEdit_Click" IsEnabled="True"/&gt;
          &lt;shell:ApplicationBarIconButton IconUri="/Icons/appbar.delete.rest.png" Text="Delete" Click="btnDelete_Click" IsEnabled="True"/&gt;
          &lt;shell:ApplicationBarIconButton IconUri="/Icons/appbar.feature.email.rest.png" Text="Email"  Click="btnEmail_Click" IsEnabled="True"/&gt;
          &lt;shell:ApplicationBarIconButton IconUri="/Icons/appbar.back.rest.png" Text="Back" Click="btnBack_Click" IsEnabled="True"/&gt;
  
      &lt;/shell:ApplicationBar&gt;
  &lt;/phone:PhoneApplicationPage.ApplicationBar&gt;
  </code></pre>
  
  <p><strong>.cs</strong></p>
  
  <pre><code> void btnBack_Click(object sender, EventArgs e)
  
      {
          NavigationService.Navigate(new Uri("/Library.xaml", UriKind.Relative));
      }
  
      void btnDelete_Click(object sender, EventArgs e)
      {
          MessageBox.Show("Can click");
      }
  </code></pre>
  
  <p>Can anyone help me with it. Thanks.</p>