How can i change from Text into Password?

I am a very new Xamarin Developer an i want to change a EditText from "Text" into "Password".
When i Check the first time, then the password Field change to Text. But when i uncheck it, then nothing happens. Why?

`

        var benutzer = FindViewById<EditText>(Resource.Id.benuzername);
        var password = FindViewById<EditText>(Resource.Id.password);
        var pwanzeigen = FindViewById<CheckBox>(Resource.Id.pwanzeigen);
        var btn = FindViewById<Button>(Resource.Id.weiter);


        pwanzeigen.Click += (o, e) => {
            if(pwanzeigen.Checked)
                password.InputType = Android.Text.InputTypes.TextVariationVisiblePassword;
            else
                password.InputType = Android.Text.InputTypes.TextVariationPassword;

        };`

Best Answer

Answers

Sign In or Register to comment.