title: WPF closing child- closes parent-window
body: <p>i have the pretty same sample as mentioned <a href="http://blogs.microsoft.co.il/blogs/tal_pasi/archive/2011/01/13/wpf-main-window-disappears-when-closing-the-last-owned-child-window.aspx" rel="nofollow">here</a>. 
  Fast concluded: MainWindow closes when the last childwindow is closed.</p>
  
  <p>My Problem: I couldn't solve my problems with the described solutions. I can't produce a program where it als takes place. Only in one of my bigger progs. Maybe someone has an idea or knows any further steps.</p>
  
  <p>Thanks for reading - Thomas</p>
  
  <p>As requested here's a bit of code:
  This is the part in the MainWindow:</p>
  
  <pre><code>bool editAfterSearch = false;
  Movie selectedMovie = (Movie)this.listView.SelectedItem;
  Movie backup = (Movie)selectedMovie.Clone();            
  
  if (new OnlineSearchWindow().EditMovieViaOnlineSearch(ref selectedMovie, out editAfterSearch))
  {
      this.coverFlow.Update(selectedMovie);
  }
  </code></pre>
  
  <p>And that's the part of the ChildWindow:</p>
  
  <pre><code>public bool EditMovieViaOnlineSearch(ref Movie preset, out bool editAfter)
  {
      this.exitWithOk = false;
      this.editMovieAfterSearch = false;
  
      this.tbx_SearchTerm.Text = preset.Title;
      this.linkedMovie = preset;
  
      this.ShowDialog();
  
      editAfter = editMovieAfterSearch;
  
      if (this.exitWithOk)
      {
          this.linkedMovie.CloneOnlineInformation(ref preset);
          preset.Bitmap = this.linkedMovie.Bitmap;
  
          return true;
      }
      else
      {
          return false;
      }
  }
  </code></pre>