title: WPF program won't load after code change
body: <p>Application was working fine until I added code for two arrays. I have some class level strings:</p>
  
  <pre><code>string cFileName = "customer.txt";
  string[] cName = new string[0];
  string[] cPhone = new string[0];
  </code></pre>
  
  <p>And I've added this to the <code>Window_Loaded</code> event:</p>
  
  <pre><code>private void Window_Loaded_1(object sender, RoutedEventArgs e)
  {
      //read file on start
      //ReadFile();
      int counter = 0;
      string line;
      StreamReader custSR = new StreamReader(cFileName);
      line = custSR.ReadLine();
  
      while (custSR.Peek() != -1)
      {
          Array.Resize(ref cPhone, cPhone.Length + 1);
          Array.Resize(ref cName, cName.Length + 1);
  
          cPhone[cPhone.Length - 1] = line;
          cName[cName.Length - 1] = line;
          counter++;
  
          //phoneComboBox.Items.Add(cPhone[cPhone.Length - 1]);
       }
       custSR.Close();
  
       for (int i = 0; i &lt; counter; i++)
       {
           phoneComboBox.Items.Add(cPhone[i]);
       }
       //focus when program starts
       phoneComboBox.Focus();
  }
  </code></pre>
  
  <p>The reason I have <code>//ReadFile()</code> is because I tried to have it as a separate method and call to the <code>Window_Loaded</code> event. I also tried ouputting to the combo box from within the loop. I have not had this happen before and can't figure out what I've done.</p>