title: wpf window event continue raise after window is closed
body: <p>I have a problem with wpf events.
  In the xaml I have following combobox with selectionchanged event:</p>
  
  <pre><code>&lt;ComboBox Grid.Column="1" Grid.Row="1" Name ="comboBox"
            SelectedItem="{Binding CurrentEventBinding.ControlId, ValidatesOnDataErrors=True}"
            ItemsSource="{Binding ControlsNames}" SelectionChanged="ComboboxSelectionChanged"&gt;
  </code></pre>
  
  <p>In the codebehind I have following code:</p>
  
  <pre><code>private void ComboboxSelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e) {
        (DataContext as EventBindingEditViewModel).VmCommands.UpdateSourceCommand.Execute(null);
    }
  </code></pre>
  
  <p>And I have the following working scenario:
  Window.ShowDialog(); -> ComboboxSelectedChanged (the event is raised) -> CloseWindow();
  Then again: Window.ShowDialog(); -> ComboboxSelectedChanged (<strong>the event is raised twice</strong>)
  And if in the immediate window I write <code>sender.GetHashCode()</code> it returns first time the hashcode for the combobox from current window, and at the second time it returns the hashcode of the 'died' window.
  So the event is raised so many times as the window is showed. It looks like old comboboxes aren't disposed or something like that.
  Hope you understand my problem.
  Thanks in advance!</p>