title: How to access a variable from another class
body: <p>I have a class called currentUser and another called game. from game, i am trying to access a variable from currentUser, I know for sure that the variable is created and it contains something in currentUser before i call it in game but i get an empty string. What am i doing wrong here. here is what i have </p>
  
  <pre><code>public class currentUser
  {
    private string currentUser;
    public string getCurrentUser
    {
      get {return currentUser;}
      set {currentUser = value;}
    }
    //this gets pushed in the beginning of the program
    private void btn_click(object sender, RoutedEventArgs e)
    {
      currentUser = txtUsername.Text;
    }
  }
  
  public class game
  {
    currentUser myCurrentUser = new currentUser();
    string var = myCurrentUser.getCurrentUser();
    //this is another method being called in another class, but i dont think it is relevant. by the time i step over to here, var is null.
    clsScores.getScore(25, var);
  }
  </code></pre>
  
  <p>i have tried looking, but this is the same example i see, so i don't know why it would not be working.</p>