Back to API Reference
Class

InputMaskBehavior

sealed
Inherits:InputBehavior

Formats input live against a pattern — phone (###) ###-####, card #### #### #### ####, date ##/##/####. Slot characters accept input — # a digit, A a letter, * a letter or digit — and every other character is a literal placed automatically. The whole field is re-formatted on every edit — typing, mid-field edits, paste, and deletion all stay aligned; a caret deletion landing on a literal removes the nearest entered character instead, and deleting the last entered character leaves the field empty (no stranded leading literals). The stored text is the formatted value; RawText returns the entered characters with literals stripped. Slots match single UTF-16 units (BMP): a supplementary-plane character never fills a slot — mask domains (phone, card, date) are BMP by nature, and the one-char-per-slot invariant is what keeps the caret math exact.

public string RawText{ get }

The entered characters with literals removed — the raw value behind the mask.

protected override void OnEnable()
protected override void OnDisable()