title: WPF best practice to get current MainWindow instance?
body: <p>I got a warning that this may be a subjective question and might be closed, but I'm going to ask anyway.</p>
  
  <p>I'm basically trying to access a button on my MainWindow in a WPF application from a UserControl that gets loaded up from within the MainWindow.</p>
  
  <p>I'm currently accessing it like this from the UserControl's code behind:</p>
  
  <pre><code>((MainWindow)Application.Current.MainWindow).btnNext
  </code></pre>
  
  <p>But it does look messy, and from what I've read is not considered a best practice. Anyone able to provide an answer that constitutes a best practice for Accessing controls / properties from the current instance of a MainWindow - or any other active windows / views for that matter?</p>