public void PasswordChanged(RoutedEventArgs e)
{
var t = e.Source as PasswordBox;
if (t != null && !string.IsNullOrEmpty(t.Password))
{
// Bugfix: cursor position
if (t.Password.Length == 1)
{
// set the cursor position to 1
SetSelection(t, 1, 0);
}
UserPassword = t.Password;
}
else
{
UserPassword = string.Empty;
}
}