title: Variables C# UWP
body: <p>I have two files. Need to get variables from one to another. I set them as global in the file where they are defined and filled. But in the second file when it reads variables, they are empty. How can I solve this problem? The code from the first file:</p>
  
  <pre><code>public sealed partial class NewOrder : Page
  {
      public string Name1;
      public string Mob;
      public string Adres;
      public string Email;
      public string telephone; 
  
  
      public NewOrder()
      {
          searchButton.Click += async delegate
   { 
          telephone = searchtext.Text;
  
          using (MySqlConnection connection = new MySqlConnection("...."))
          {
              connection.Open();
              MySqlCommand createCommand = new MySqlCommand(
                  "SELECT * FROM customers WHERE mob LIKE N'" + telephone + "'", connection);
  
              EncodingProvider ppp;
              ppp = CodePagesEncodingProvider.Instance;
              System.Text.Encoding.RegisterProvider(ppp);
              MySqlDataReader reader = createCommand.ExecuteReader();
  
              if (reader.HasRows)
              {
                  while (reader.Read())
                  {
                      Name1 = reader.GetString(1);
                      Mob = reader.GetString(2);
                      Adres = reader.GetString(3);
                      Email = reader.GetString(4);
                  }
              }
          }
      }
  }
  }
  </code></pre>
  
  <p>The code from the second file:</p>
  
  <pre><code>public sealed partial class Details : Page
  {         
      public Details()
      {
          this.InitializeComponent();
  
          NewOrder A = new NewOrder();
          name.Text = A.Name1;
          tel.Text = A.Mob;
          adres.Text = A.Adres;
          email.Text = A.Email;                       
      }                   
  }
  </code></pre>
  
  <p>That what I see.<br>
  The exception is here: <code>name.Text = A.Name1;</code></p>
  
  <blockquote>
    <p>An exception of type 'System.ArgumentNullException' occurred in
    mscorlib.ni.dll but was not handled in user code</p>
    
    <p>Additional information: Value cannot be null.</p>
  </blockquote>