mobilecontrols-devexpress-dot-xamarinforms-dot-editors-5a94d031.md
An editor that allows users to enter and manage passwords.
Namespace : DevExpress.XamarinForms.Editors
Assembly : DevExpress.XamarinForms.Editors.dll
NuGet Package : DevExpress.XamarinForms.Editors
public class PasswordEdit :
TextEditBase
PasswordEdit is a single-line text editor that can hide entered characters.
It initially displays the input box and the default show/hide password icon.
You can also add the following optional elements:
Use the Text property to obtain or set the password entered in the editor.
To manage the cursor position and text selection, use the CursorPosition and SelectionStart/SelectionLength properties.
The Keyboard property specifies the type of the keyboard used to edit text in the editor. The ReturnType property allows you to change the appearance of the return button on the keyboard. When a user taps this button, the Completed event occurs.
Use the following properties to change the input text appearance and alignment:
|
Property
|
Description
| | --- | --- | |
|
Specify the text color for different states of the editor.
| |
TextFontSize
TextFontFamily
TextFontAttributes
|
Configure the font settings.
| |
|
Gets or sets the horizontal alignment of text entered in the editor.
|
You can also use the CursorColor property to customize the color of the input cursor.
A label is the editor’s input prompt string (LabelText). Editors display this string inside the edit box (when the editor is empty and not focused) or at the top of the editor.
To pin the label to the top edge of the editor box, set the IsLabelFloating property to false.
To customize the label’s appearance settings, use the following properties:
|
Property
|
Description
| | --- | --- | |
LabelColor / FocusedLabelColor
DisabledLabelColor / ErrorColor
|
Specify the label color for each state of the password editor.
| |
LabelFontSize
TextFontFamily
TextFontAttributes
|
Configure the label font settings.
|
A placeholder (PlaceholderText) is the input prompt string displayed within the text box when the editor is empty.
To specify the placeholder text color, use the PlaceholderColor property.
You can display the following labels:
The BottomTextTopIndent property specifies the indent between the editor’s bottom border and help or error text.
The ReserveBottomTextLine property allows you to reserve space under the editor box to show one line of text when required (for example, to show an error message when an incorrect password is identified).
To specify the color and font attributes for the help and error text, use the following properties:
|
Property
|
Description
| | --- | --- | |
HelpTextColor / DisabledHelpTextColor
|
Specify the help text color for different states of the text editor.
| |
|
Specify the error message text color.
| |
BottomTextFontSize
BottomTextFontFamily
BottomTextFontAttributes
|
Configure the font settings.
|
If the editor’s AutofillContentType property is set to Password, the user can automatically fill the editor with an appropriate password. Note that the device should have an enabled autofill service that contains the required values (names, dates, passwords, and so on).
The password editor can display icons within its box.
Use the following members to manage the editor’s icons:
|
Icon
|
Property
|
Description
| | --- | --- | --- | |
Password Icon
|
|
Specifies the hide/show password icon visibility.
| |
ShowPasswordIcon / HidePasswordIcon
|
Allow you to replace the default password icon with a custom icon.
| |
Clear Icon
|
|
Specifies when the clear icon is displayed.
| |
|
Specifies the clear icon image.
| |
ClearIconClicked / ClearIconCommand
|
Allow you to assign an additional action to the clear icon.
| |
|
Gets or sets the color of the clear icon.
| |
Error Icon
|
|
Specifies the error icon image.
| |
ErrorIconClicked / ErrorIconCommand
|
Allow you to perform an action when a user clicks the error icon.
| |
|
Gets or sets the color of an icon displayed when HasError is set to true.
| |
Custom Icons
|
|
Specify custom icons.
| |
StartIconClicked / StartIconCommand
EndIconClicked / EndIconCommand
|
Allow you to perform an action when a user clicks a custom icon.
| |
|
Specify icon colors.
| |
IsStartIconVisible / IsEndIconVisible
|
Specifies whether an icon is visible.
| |
Common
|
|
Specify icon colors for different states of the password editor.
| |
|
Gets or sets the distance between an icon and input text (affix).
| |
|
Gets or sets the distance between icons.
| |
|
Gets or sets the vertical alignment of icons.
|
Editors raise the following events on user interaction:
If you limit input string length (MaxCharacterCount), the editor displays a character counter under the text box.
Use the MaxCharacterCountOverflowMode property to prevent users from entering more characters than MaxCharacterCount.
To specify the space between the character counter and help text, use the CharacterCounterIndent property.
Use the following properties to change the appearance of the edit box and its borders:
|
Property
|
Description
| | --- | --- | |
BorderColor
DisabledBorderColor
FocusedBorderColor
|
Specify the border color for each state of the editor.
| |
|
Specifies the color of the edit box borders, label, and error icon and error message if there is an input error.
| |
BorderThickness
DisabledBorderThickness
FocusedBorderThickness
|
Specify the border thickness for each state of the editor.
| |
|
Specifies whether edit box corners are rounded or cut.
| |
|
Specifies the radius of the edit box corners.
| |
BackgroundColor
DisabledBackgroundColor
|
Specifies the edit box fill color.
| |
|
Specifies the amount of space between edit box borders and content.
|
The CursorColor property specifies the color of the input cursor. To specify the text color, use the TextColor property.
Xamarin.Forms.IElementController
Object EditBase TextEditBase PasswordEdit
See Also