title: run a method in the main windows from another windows in C# wpf
body: <p>Hello i am working on project have two windows  the first is the main windows and it contain a public method and the other is secondary windows and contain a button .. what i want is when i press the button on the secondary windows the button will call the method on the main windows 
  here what i try </p>
  
  <p>the code of the main windows : </p>
  
  <pre><code>public partial class MainWindow : Window
  {
      public MainWindow()
      {
          InitializeComponent();
      }
      public void the_public_method()
      {
          //code 
      }
  </code></pre>
  
  <p>and the code of the secondary windows : </p>
  
  <pre><code>public partial class windows2 : Window
  {
      public windows2()
      {
          InitializeComponent();
      }
  
      private void button_Click(object sender, RoutedEventArgs e)
      {
          // dont know what to put here 
      }
  }
  </code></pre>
  
  <p>Please help </p>