title: In WPF, how to call an owner window method from child window inside BackgroundWorker without instantiation?
body: <p>In the <strong>MainWindow</strong>, I could call <strong>MyMethod</strong> from <strong>DoWork</strong> event easily, and that works fine since <strong>MyMethod</strong> doesn't have access to any UI control.</p>
  
  <p>My question is how to call the same method (MyMethod) in the <strong>child</strong> window without <strong>instantiation</strong> a new object, where the following statement works correctly <strong>outside</strong> the BackgroundWorker</p>
  
  <pre><code>((MainWindow)this.Owner).MyMethod();
  </code></pre>
  
  <p>But <strong>inside</strong> the BackgroundWorker (in the child Window) this statement throws an Exception, although it doesn't have any access to UI and it could be called inside the BackgroundWoerker in the MainWindow.</p>
  
  <p>Any attempt to help me will be appreciated.</p>