title: How to avoid multiple event fire when WPF page is opened again?
body: <p>I have a frame and few pages in my WPF application.</p>
  
  <p>My navigation is controlled by buttons. On each button I have click handler that creates new page with some parameters:</p>
  
  <pre><code>private void ButtonProductionAuto_OnClick(ref TechModbus, RoutedEventArgs e)
  {
      FrameMain.Content = new PageProductionAuto(someobject, this);
  }
  
  private void ButtonProductionManual_OnClick(ref TechModbus, RoutedEventArgs e)
  {
      FrameMain.Content = new PageProductionManual(someobject, this);
  }
  </code></pre>
  
  <p>When I'm switching between pages - previous pages still exist in memory and they react on some custom events.</p>
  
  <p>(edit)</p>
  
  <p>This is my code related with events:</p>
  
  <pre><code>public PageProductionAuto(ref TechModbus modbus, MainWindow wnd)
  {        
      // ...
  
      wnd.KeyDown += Wnd_KeyDown;
      wnd.KeyUp += Wnd_KeyUp;
      m.OnReadFinished += Modbus_OnReadFinished;
  
      // ...
  }
  </code></pre>
  
  <p>How can I dispose these pages or how can I avoid double-fire on my events when page is opened second time?</p>