title: How to access WPF MainWindows Controls from another class in the same namespace?
body: <p>I have MainWindows.cs like that:  </p>
  
  <pre><code>namespace LiniaProdukcyjna
  {
     /// &lt;summary&gt;
     /// Interaction logic for MainWindow.xaml
     /// &lt;/summary&gt;
     public partial class MainWindow : Window
     {
        public MainWindow()
        {
           InitializeComponent();
        }
     }
  }
  </code></pre>
  
  <p>And I have CSilnik class:</p>
  
  <pre><code>namespace LiniaProdukcyjna
  {
      class CSilnik
      {
          ICollection&lt;CLinia&gt; linie;
  
          public void permut(int k, int n, int[] nums)
          {
              int i, j, tmp;
  
              /* when k &gt; n we are done and should print */
              if (k &lt;= n)
              {
  
                  for (i = k; i &lt;= n; i++)
                  {
                      tmp = nums[i];
                      for (j = i; j &gt; k; j--)
                      {
                          nums[j] = nums[j - 1];
                      }
                      nums[k] = tmp;
  
                      /* recurse on k+1 to n */
                      permut(k + 1, n, nums);
  
                      for (j = k; j &lt; i; j++)
                      {
                          nums[j] = nums[j + 1];
                      }
                      nums[i] = tmp;
                  }
              }
              else
              {
                  linie.Add(new CLinia(nums));
                  // here i want to do something with ListView in MainWindow
              }
          }
      }
  }
  </code></pre>
  
  <p>and CLinia class:</p>
  
  <pre><code>namespace LiniaProdukcyjna
  {
      class CLinia
      {
          int koszt;
          int[] kolejnosc;
  
          public CLinia(int[] inKolejnosc)
          {
              kolejnosc = inKolejnosc;
          }
  
      }
  }
  </code></pre>
  
  <p>And I have ListView control in MainWindow.
  I want to modify ListView "lista" in MainWindow, but I cannot access to them.
  What I have to do to accessing to controls like: lista.Items.Add ?</p>