title: How to override a method in another page in WP8?
body: <p>I am working on an app involving reading an NFC tag via the ProximityDevice class. The idea is when the tag is successfully read on the main_page, it will navigate to the second_page where all the processing of the tag content will be done. When it reaches the second_page, the app must not be able to read any tag anymore, unless it goes back to the main_page.</p>
  
  <p>The problem is when the app navigates to the second_page, it still reads tags and executes the methods I declared on the main_page. It seems like the methods are inherited on the second_page.</p>
  
  <p>Is there a way to:
  (1) fully disable reading proximity devices, and re-enable it when necessary; OR
  (2) override the inherited methods from the main_page?</p>
  
  <p>I have tried:
  (1) using stopSubscribingForMessage right before navigating to the next page, BUT it still reads the succeeding tags;
  (2) declaring new methods for reading tags on the second_page - these new methods were executed, ALONG with the methods from the main_page.</p>
  
  <p>Here's my code:</p>
  
  <p>(main_page)</p>
  
  <pre><code>public MainPage()
  {
  InitializeComponent();
  device = ProximityDevice.GetDefault();
          if (device != null)
          {
              device.DeviceArrived += ProximityDeviceArrived;
          }
          else
          {
              MessageBox.Show("Failed to initialize proximity device.");
          }
  
  }
  
  public void ProximityDeviceArrived(Windows.Networking.Proximity.ProximityDevice device)
  {
  device.SubscribeForMessage("NDEF", ProcessDeviceMessage);
  }
  
  public void ProcessDeviceMessage(ProximityDevice sender, ProximityMessage message)
  {
  //reads tag content
  sender.StopSubscribingForMessage(message.SubscriptionId);
      NavigationService.Navigate(new Uri("/Result.xaml?tagContent=" + tagContent, UriKind.Relative));
  }   
  </code></pre>
  
  <p>(second_page)</p>
  
  <pre><code>protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
  {
          base.OnNavigatedTo(e);
          string tagContent = NavigationContext.QueryString["tagContent"];
          //process tag content
      device = ProximityDevice.GetDefault();
          if (device != null)
          {
              device.DeviceArrived += ProximityDeviceArrived;
          }
          else
          {
              MessageBox.Show("Failed to initialize proximity device.");
          }
  }
  
  public void ProximityDeviceArrived(Windows.Networking.Proximity.ProximityDevice device)
  {
          device.SubscribeForMessage("NDEF", ProcessDeviceMessage);
  }
  
  public void ProcessDeviceMessage(ProximityDevice sender, ProximityMessage message)
  {
          Debug.WriteLine("You tapped your tag again. I will do nothing.");
  }
  </code></pre>
  
  <p>I really hope you could help me out!</p>