title: How to create custom control with buttons and how to add event button click event in silverlight for windows mobile 7
body: <p>as i am following link for creating custom control for my application.
  <a href="http://www.windowsphonegeek.com/articles/Creating-a-WP7-Custom-Control-in-7-Steps" rel="nofollow">http://www.windowsphonegeek.com/articles/Creating-a-WP7-Custom-Control-in-7-Steps</a></p>
  
  <p>can anyone tell me how to add button in custom control and add event handler for click event in that? </p>
  
  <p>I added click event using following piece of code 
         `</p>
  
  <pre><code>public override void OnApplyTemplate()
          {
              base.OnApplyTemplate();
              Button btn1, btn2, btn3, btn4;
  
              btn1 = GetTemplateChild("MyButton1") as Button;
              btn1.Click += new RoutedEventHandler(btn1_Click);
              btn2 = GetTemplateChild("MyButton2") as Button;
              btn2.Click += new RoutedEventHandler(btn2_Click);
              btn3 = GetTemplateChild("MyButton3") as Button;
              btn3.Click += new RoutedEventHandler(btn3_Click);
              btn4 = GetTemplateChild("MyButton4") as Button;
              btn4.Click += new RoutedEventHandler(btn4_Click);
          }`
  </code></pre>
  
  <p>Now if i want to navigate to some page after clicking buttons.</p>
  
  <p>how to do that?? I am not getting "NavigationService.Navigate" option in button click event.</p>
  
  <p>thanx in advance. :)</p>