title: Use value of passwordbox as to a variable
body: <p>i have a password box and i want to get the input data to check for verification.</p>
  
  <p>My passwordbox c# code</p>
  
  <pre><code>  public void textBox2_TextInput(object sender, TextCompositionEventArgs e)
      {
          //pass = textBox2.ToString();
      }
  </code></pre>
  
  <p>and the xaml code</p>
  
  <pre><code>&lt;PasswordBox Name="textBox2" 
               PasswordChar="*"  
               TextInput="textBox2_TextInput" /&gt;
  </code></pre>
  
  <p>this is what i have written to capture the password</p>
  
  <pre><code>  private void loginbutton_Click(object sender, RoutedEventArgs e)
     {
         usr = textBox1.Text;
         SecureString passdat =textBox2.SecurePassword;
         pass = passdat.ToString();
     }             
  </code></pre>
  
  <p>it returns null.This is a dummy demo so no encryption is required.I was using a text box earlier and the verification worked.using a password box just complicated things.</p>