title: accessing non-static method from another class without instantiate
body: <p>Title is my question. I will explain below. </p>
  
  <p>I am working on wpf application is vs2010. I have two windows, one is my MainWindow and another is a fileList window. In my fileList window, I have a list of files, which on click, should load the file. The onClick method is implemented in fileList class. The function to load the file is implemented in MainWindow partial class. </p>
  
  <p>My fileList class in instantiated in MainWindow class to show the window. I cant instantiate MainWidow again. The function(method) in MainWindow can't be declared static because it uses  other parameter which I can't (don't know how to) declared static.</p>
  
  <p>I am pasting relevant code below. Kindly help.</p>
  
  <pre><code>namespace test
  {
    public partial class MainWindow : Window
       fileList fl = new fileList;
  
       public MainWindow()
       {
        InitializeComponent();
        fl.show();
        }
  
        public void porcessfile(string path)
        {
         //this method processes the the file at "path". It uses combobox and scrollviewer 
         //declared in xaml. I dont know how to declare static in xaml, else I will declare       
         //them static and change the whole method to static, so I can call it without  
         //instantiating. I tried making a nested-class, but then I can't  access variable 
         //declared in MainWindow (parent) class. Or there is a way to do that?
  
        }
  }
  </code></pre>
  
  <p>and the other class:</p>
  
  <pre><code>namespace test
  {
    public partial class fileList : Window
    {
       public fileList()
       {
          IntializeComponent();
       }
  
  
  
       private void Button_click(object sender, RoutedEventsArgs e)
       {
        //code that gets "path" on click, works fine.
  
        processfile(string path); // what and how to do here.
       }
    }
  
  } 
  </code></pre>
  
  <p>I sincerely hope I am clear. Please ask details if required. </p>