title: closing WPF Window does not start destruction
body: <p>Assume following scenario:
  There is a WPF window, within a MVVM implementation. Having following code in it's code behind file (acutally I know I rather should use ViewModel first approach, but using View First is enough at this stage):</p>
  
  <pre><code>public MainWindow()
  {
      InitializeComponent();
      this.DataContext = MainWindowViewModel.GetInstance();
  }
  </code></pre>
  
  <p>within the constructor of </p>
  
  <pre><code>ClassStartingWorkerThread instance;
  MainWindowViewModel()
  {
      instance = new ClassStartingWorkerThread();
  }
  </code></pre>
  
  <p>I initialize an instance of a class which starts a Thread on construction like shown below:</p>
  
  <pre><code>ClassStartingWorkerThread()
  {
      StartThread();
  }
  
  private Thread mEventRequestingThread = null;
  private void StartThread()
  {
      ThreadStart cDelegate = new ThreadStart(EventListening);
      mEventRequestingThread = new Thread(cDelegate);
      mEventRequestingThread.Start();
  }
  </code></pre>
  
  <p>This class implements the IDisposable interface.
  Therefore I call my Dispose method manually on Destruction like this:</p>
  
  <pre><code>~ClassStartingWorkerThread()
  {
      Dispose(false);
  }
  
  public void Dispose()
  {
      mEventRequestingThread.Abort();
  }
  </code></pre>
  
  <p>At least you shall know: I start my application from Visual Studio.
  Now, I'm closing my UI Window and would expect my routine to destruct created objects.
  But the the Visual Studio does not go back into "edit" mode and stays in "debug" mode.</p>
  
  <p>I guess there's something wrong with my thread routine, but I'm wondering why neither the MainWindow destructor nor the MainWindowViewModel destructor is called.</p>
  
  <p>This leads to the question on how I can manually start the destruction routine and tell my worker thread, which actually seems to block this, to stop?</p>
  
  <p>Thanks in advance,
  Thomas</p>