We have the following scenario:
PasswordBox
)
depending on your understanding of mvvm (in my way code behind is allowed in some cases)
so i create a PasswordBox and also a named TextBlock
Xaml
codebehind
private void pwBoxUser_PasswordChanged(object sender, RoutedEventArgs e)
{
var pBox =sender as PasswordBox;
string blank=pBox.Password;
//to crypt my blank Password
var sMD5 = myMD5.toMD5(blank); //implement your crypt logic here
blank ="";
MD5pw.Text = sMD5;
}
like you can see your password is save and you can easy bind to it