title: How to call a variable from one window to another window
body: <p>I have two WPF windows: Login and Info. How can I call the variable "userName" in Login.xaml.cs to Info.xaml.cs? I want to get the input in "userName" to be displayed in a listview in Info window.</p>
  
  <p>Login.xaml.cs:</p>
  
  <pre><code>public string userName { get; set; }
  
  public void UNameInput_TextChanged(object sender, TextChangedEventArgs e)
  {
      userName = UNameInput.Text;            
  }
  </code></pre>
  
  <p>Info.xaml:            </p>
  
  <pre><code>     &lt;ListView x:Name="AInfoLv" FontFamily="Tahoma" FontSize="11" Background="White" BorderBrush="{x:Null}" Height="264" 
                            Width="262" Foreground="Black" Margin="-4,-1,0,0"&gt;
                      &lt;ListView.View&gt;
                          &lt;GridView&gt;
                              &lt;GridViewColumn x:Name="LabelColumn" Header="Label" Width="100" DisplayMemberBinding="{Binding Path=Label}"/&gt;
                              &lt;GridViewColumn x:Name="ValueColumn" Header="Value" Width="130" DisplayMemberBinding="{Binding Path=Value}"/&gt;
                          &lt;/GridView&gt;
                      &lt;/ListView.View&gt;
       &lt;/ListView&gt;
  </code></pre>
  
  <p>Info.xaml.cs:</p>
  
  <pre><code>public Info()
  {
      InitializeComponent();
  
      this.AInfoLv.Items.Add(new { Label = "Login" });
      this.AInfoLv.Items.Add(new { Label = " Username" });
  }
  </code></pre>