title: how to unsubscribe an event with parameter(s)?
body: <p>In my WPF program, I need to set aircraft failure for a flight simulation software. For example, if I click "Fire Engine 1" button on MainWindow, </p>
  
  <pre><code>    private DispatcherTimer DT;
  
      private void button_Engine_1_On_Fire(object sender, RoutedEventArgs e)
      {
          SettingFailureCondition("Fire engine 1");
      }
  </code></pre>
  
  <p>Then a pop-up window instance "ftc" will show up for user to set the condition to trigger the failure</p>
  
  <pre><code>    private void SettingFailureCondition(string failure_name)
      {
        FailureTriggerCondition ftc = new FailureTriggerCondition();
        ...
        if (ftc.ShowDialog() == true)
        {
           if(altitude&gt;input)//if the altitude in the software higher than user's input
           {
              DT.Tick += new EventHandler((sender, e)=&gt;MoveFailureByFlag(failure_name, flag));
              DT.Interval = new TimeSpan(0, 0, 0, 1);
              DT.Start();
              DT.Tick -= new EventHandler((sender, e)=&gt;MoveFailureByFlag(failure_name, flag));//Why can't this unsubscribe the event?
           }
        }
      }
  </code></pre>
  
  <p>As for the above code, I need to detect if the altitude meets the requirement once per second. <strong>But once it is met, execute <code>MoveFailureByFlag</code> and stop detecting it.</strong> How to do it?</p>
  
  <pre><code>if(altitude&gt;input)//once this is met, execute function MoveFailureByFlag then stop detecting it  
  </code></pre>
  
  <p>I am thinking about unsubscribing the event but can't find a way in this case. 
  The following fails but I don't know why.</p>
  
  <pre><code>DT.Tick -= new EventHandler((sender, e)=&gt;MoveFailureByFlag(failure_name, flag));//Why can't this unsubscribe the event?
  </code></pre>
  
  <p>Thanks for any help.</p>