I use an EditText to enter password. And a CheckBox to show password or not. Below function is the part:
public void ShowPassword() {
if (cb.isChecked()) {
on the off chance that you are using Xamarin (Visual Studio Mac as it's now called) you can achieve it this way (I used a Switch)
///
/// Toggles the password.
///
/// Field.
/// If set to true is checked.
private void TogglePassword(TextView field, bool isChecked)
{
/// masks with password character
if (isChecked)
{
field.TransformationMethod = new PasswordTransformationMethod();
}
/// unmasks password
else
{
field.TransformationMethod = null;
}
Then on your Switch .click do something like this
switch.Click += delegate {
TogglePassword(textView, switch.Checked);
};