title: C# / WPF Unmask password inside the passwordBox
body: <p>How could I unmasked and masked the password inside the passwordBox whenever I click the checkBox? I'm using C# WPF template.</p>
  
  <p>Here is  my .XAML code:</p>
  
  <pre><code>&lt;PasswordBox x:Name="passwordBox_password" Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2" Margin="5" Height="25" /&gt;
          &lt;CheckBox x:Name="checkBox_showPassword" Grid.Row="3" Grid.Column="1" Margin="5,0,5,5" Content="show password" Checked="checkBox_showPassword_Checked" Unchecked="checkBox_showPassword_Unchecked" /&gt;
  </code></pre>
  
  <p>Here is my .CS code:</p>
  
  <pre><code>private void checkBox_showPassword_Checked(object sender, RoutedEventArgs e)
      {
          // what to do here ?
      }
  
      private void checkBox_showPassword_Unchecked(object sender, RoutedEventArgs e)
      {
          // what to do here ?
      }
  </code></pre>
  
  <p>Or is there another way to do it in WPF?</p>