title: How to Access Window Object declared in App.xaml in class file in WPF?
body: <p>I have  Window object in App.xaml.cs file which is public. Now, i want to access this window object in class file. Is it possible?</p>
  
  <p>In App.xaml.cs file:</p>
  
  <pre><code>public partial class App : Application
      {
           public MyWindow mainWindowObj;
  
          void App_Startup(object sender, StartupEventArgs e)
          {
              mainWindowObj = new MyWindow();
              mainWindowObj.Show();
          }
      }
  </code></pre>
  
  <p>In Some Classfile.cs i want to access the 'mainWindowobj'. I have tried following in Classfile.cs but error:</p>
  
  <pre><code>((App)Application.Current).mainWindowObj.Title="Hello";
  </code></pre>
  
  <p>this above line is sample i want to access the variables,objects inside this forms.</p>
  
  <p>Help Appreciated!</p>