title: how to display a pop up message with ok and cancel button in windows phone 7 application development
body: <p>I am building an app for windows phone 7. I want to display a messagebox with both OK and Cancel button. Moreover the message box should come in the center of the application. Is it possible to have a design in my messagebox other than the message box shown by defaut?</p>
  
  <p>My code is:</p>
  
  <pre><code> using System;
   using System.Collections.Generic;
   using System.Linq;
   using System.Net;
   using System.Windows;
   using System.Windows.Controls;
   using System.Windows.Documents;
   using System.Windows.Input;
   using System.Windows.Media;
   using System.Windows.Media.Animation;
   using System.Windows.Shapes;
   using Microsoft.Phone.Controls;
  
   namespace KejriwalPhoneApp
  {
  public partial class Donate : PhoneApplicationPage
  {
      public Donate()
      {
          InitializeComponent();
  
      }
  
  protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
  {
      base.OnNavigatedTo(e);
  
      var customMessageBox = new CustomMessageBox()
      {
          LeftButtonContent = "Ok",
          RightButtonContent = "Cancel",
          Content = new TextBlock()
          {   // All TextBlock (or other control) properties are work here
              Text = "This Will Take You Out Of The App And Forward You To Our Contribution Website!",
              TextWrapping = TextWrapping.Wrap
          }
      };
  
      customMessageBox.Dismissed += (sender, args) =&gt;
      {
          if (args.Result == CustomMessageBoxResult.LeftButton)
          {
              // Action when "ok" pressed
              donation.Source = new Uri("http://mobiledonation.vzons.com/ArvindKejriwal", UriKind.Absolute);
  
              donation.Loaded += (object sender, RoutedEventArgs e) =&gt;
              {
                  donation.Navigate(new Uri("http://mobiledonation.vzons.com/ArvindKejriwal", UriKind.Absolute));
              };
          }
          else if (args.Result == CustomMessageBoxResult.RightButton)
          {
              // Action when "cancal" pressed, optional
          }
          else
          {
              // Action when back key pressed, optional
          }
      };
  
      customMessageBox.Show();
  }
  
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>This is my complete code now for displaying a pop up message. I am getting the following error:</p>
  
  <pre><code>1. The type or namespace name 'CustomMessageBox' couldnot be found
  2. The name CustomMessageBoxResult doesnot exist in the current context
  3. A local variable named 'sender' cannot be declared in this scope because it would    give a different meaning to 'sender', which is already used in a 'parent or current' scope to denote something else
  4. A local variable named 'e' cannot be declared in this scope because it would give a     different meaning to 'e', which is already used in a 'parent or current' scope to   denote something else
  5. The name 'CustomMessageBoxResult' does not exist in the current context  
  </code></pre>
  
  <p>Please help me to fix these</p>