Show Password Character in Xamarin Masked Entry (SfMaskedEdit)

26 Nov 20211 minute to read

The SfMaskedEdit control supports to work as a password text box when setting a character to the PasswordChar property.

<syncfusion:SfMaskedEdit x:Name="maskedEdit" Mask="\w+" MaskType="RegEx" PasswordChar="*"  />
SfMaskedEdit maskedEdit = new SfMaskedEdit();
maskedEdit.Mask = @"\w+";
maskedEdit.MaskType = MaskType.RegEx;
maskedEdit.PasswordChar = '*';

Show Password Char

Password Delay

When providing password character, you can show the typed character with some delay using the EnablePasswordDelay property. When enabling the EnablePasswordDelay property, the typed character will be displayed for a few seconds before it is converted to the password character.

<syncfusion:SfMaskedEdit x:Name="maskedEdit" PasswordChar="*" EnablePasswordDelay="True" />
SfMaskedEdit maskedEdit = new SfMaskedEdit();
maskedEdit.PasswordChar = '*';
maskedEdit.EnablePasswordDelay = true;

Delay password character

NOTE

The default value of the EnablePasswordDelay property is false.

Password Delay Duration

When “PasswordDelay” is enabled, you can handle the duration of the displaying typed character using the PasswordDelayDuration property.

<syncfusion:SfMaskedEdit x:Name="maskedEdit" Mask="\w+" MaskType="RegEx" PasswordChar="*" EnablePasswordDelay="True" PasswordDelayDuration="2" />
SfMaskedEdit maskedEdit = new SfMaskedEdit();
maskedEdit.Mask = @"\w+";
maskedEdit.MaskType = MaskType.RegEx;
maskedEdit.PasswordChar = '*';
maskedEdit.EnablePasswordDelay = true;
maskedEdit.PasswordDelayDuration = 2;