TextField

A single-line text input.
public class TextField : Control

Properties

Autocorrection

Whether the keyboard autocorrects and spell-checks the input.

Type: bool

public bool Autocorrection { get; set; }

Capitalization

When typing is automatically capitalized.

Type: Capitalization

public Capitalization Capitalization { get; set; }

ClearButton

When the field shows its built-in clear button.

Clearing preserves focus and updates Text and TextChanged.

Type: ClearButton

public ClearButton ClearButton { get; set; }

ContentKind

What the field holds, so the system can offer autofill (passwords, one-time codes, contacts).

Type: ContentKind

public ContentKind ContentKind { get; set; }

FontDesign

The system font design the text uses.

Type: FontDesign

public FontDesign FontDesign { get; set; }

FontSize

Font size in points.

Type: Bindable<double>

public Bindable<double> FontSize { get; set; }

FontWeight

The weight the text is drawn at.

Type: FontWeight

public FontWeight FontWeight { get; set; }

Keyboard

Which on-screen keyboard to show while editing.

Type: KeyboardType

public KeyboardType Keyboard { get; set; }

KeyboardAccessory

A custom view above the raised keyboard.

Wins over KeyboardToolbar; one view per field.

Type: View?

public View? KeyboardAccessory { get; set; }

KeyboardLook

The color scheme of the raised keyboard.

Type: KeyboardLook

public KeyboardLook KeyboardLook { get; set; }

KeyboardToolbar

A bar above the raised keyboard with Done and optional previous/next arrows.

Type: KeyboardToolbar

public KeyboardToolbar KeyboardToolbar { get; set; }

LeadingIcon

The local icon shown before the text, or null for none.

Type: ImageSource?

public ImageSource? LeadingIcon { get; set; }

Placeholder

Placeholder text shown when empty.

Type: Bindable<string?>

public Bindable<string?> Placeholder { get; set; }

RequiresText

Whether the return key is disabled while the field is empty.

Type: bool

public bool RequiresText { get; set; }

ReturnKey

The label shown on the keyboard's return key.

Type: ReturnKeyType

public ReturnKeyType ReturnKey { get; set; }

SubmitCommand

Command invoked when the user taps the keyboard's return key.

Type: ICommand?

public ICommand? SubmitCommand { get; set; }

SubmitCommandParameter

The parameter passed to SubmitCommand.

Type: object?

public object? SubmitCommandParameter { get; set; }

Text

The current text.

Type: Bindable<string>

public Bindable<string> Text { get; set; }

TextChanged

Invoked with the new value whenever the text changes.

Type: Action<string>?

public Action<string>? TextChanged { get; set; }

TrailingIcon

The local icon shown after the text, or null for none.

Shares the trailing slot with ClearButton, so an icon hides the clear button.

Type: ImageSource?

public ImageSource? TrailingIcon { get; set; }