Implementing .NET MAUI Masked Entry
The Syncfusion .NET MAUI Masked Entry (SfMaskedEntry) is an advanced input control that restricts and formats user input using customizable mask patterns. It provides automatic validation, formatting, and visual feedback for structured data entry like phone numbers, dates, emails, product keys, and more.
When to Use This Skill
Use this skill when users need to:
- Formatted Input Fields: Phone numbers, dates, times, SSN, credit cards, ZIP codes, product keys
- Restricted Character Entry: Only accept specific characters (digits, letters, alphanumeric)
- Pattern Validation: Validate input against fixed or variable-length patterns
- Automatic Formatting: Apply separators, delimiters, and formatting as user types
- Culture-Specific Input: Handle currency symbols, date/time separators, decimal formats
- Password Fields with Masking: Show/hide characters with customizable delay
- Email and URL Validation: Use RegEx patterns for complex validation
- Data Entry Forms: Improve UX with guided input and instant feedback
- Accessibility Requirements: Provide clear input expectations with prompts and validation
Component Overview
Key Capabilities:
- Two mask types: Simple (fixed patterns) and RegEx (flexible patterns)
- Customizable prompt characters showing expected input positions
- Flexible value formatting (include/exclude prompts and literals)
- Real-time validation with multiple validation modes
- Rich event system for monitoring and controlling input
- Extensive customization (colors, fonts, borders, clear button)
- Culture support for international formats
- Password masking with visibility control
- Modern Liquid Glass effect integration
- Full accessibility and automation support
Documentation and Navigation Guide
Getting Started
📄 Read: references/getting-started.md
- Installation and NuGet package setup
- Handler registration in MauiProgram.cs
- Basic MaskedEntry implementation
- Setting mask patterns and types
- Configuring prompt characters
- Setting and retrieving values
- First working example
Mask Types and Patterns
📄 Read: references/mask-types.md
- Simple mask type and elements (0, 9, #, L, ?, C, A, <, >)
- RegEx mask type and patterns
- Complete element reference tables
- Examples: phone numbers, dates, emails, product keys
- Case conversion and special characters
- When to use Simple vs RegEx
- Performance considerations
Value Formatting and Display
📄 Read: references/value-formatting.md
- ValueMaskFormat options
- ExcludePromptAndLiterals (typed only)
- IncludePrompt (with prompt chars)
- IncludeLiterals (with separators)
- IncludePromptAndLiterals (all characters)
- Use cases for data storage vs display
- Visual comparisons and examples
Validation and Events
📄 Read: references/validation-and-events.md
- ValidationMode (KeyPress, LostFocus)
- HasError property for validation status
- Focused/Unfocused events
- Focus() and Unfocus() methods
- ValueChanging event (cancelable, with IsValid, NewValue, OldValue, Cancel)
- ValueChanged event (with IsMaskCompleted)
- Completed event (return key)
- ClearButtonClicked event
- Event lifecycle and best practices
Customization and Styling
📄 Read: references/customization.md
- Clear button configuration (visibility, color, custom path)
- Font properties (size, attributes, family)
- Text and placeholder styling
- Border customization (stroke, visibility)
- Background and transparency
- Cursor position control
- Keyboard configuration
- SelectAllOnFocus behavior
- IsReadOnly mode
- Return key handling (ReturnType, ReturnCommand)
- AutomationId support for UI testing
- Platform-specific considerations
Advanced Features
📄 Read: references/advanced-features.md
- Culture support (currency, date/time separators, decimal/group separators)
- HidePromptOnLeave for cleaner UI
- Password masking (PasswordChar, PasswordDelayDuration)
- Liquid Glass Effect integration
- RTL support
- Accessibility features
- Performance optimization
- Edge cases and troubleshooting
1---
2name: syncfusion-maui-masked-entry
3description: Implements Syncfusion .NET MAUI Masked Entry (SfMaskedEntry) control for restricted, formatted text input with mask patterns. Use when working with masked input, text masks, formatted entry, phone number input, date input with format, or validation with masks. Covers Simple masks, RegEx masks, prompt characters, and automatic formatting with validation.
4metadata:
5 author: "Syncfusion Inc"
6 version: "34.1.29"
7---
8
9# Implementing .NET MAUI Masked Entry
10
11The Syncfusion .NET MAUI Masked Entry (SfMaskedEntry) is an advanced input control that restricts and formats user input using customizable mask patterns. It provides automatic validation, formatting, and visual feedback for structured data entry like phone numbers, dates, emails, product keys, and more.
12
13## When to Use This Skill
14
15Use this skill when users need to:
16
17- **Formatted Input Fields**: Phone numbers, dates, times, SSN, credit cards, ZIP codes, product keys
18- **Restricted Character Entry**: Only accept specific characters (digits, letters, alphanumeric)
19- **Pattern Validation**: Validate input against fixed or variable-length patterns
20- **Automatic Formatting**: Apply separators, delimiters, and formatting as user types
21- **Culture-Specific Input**: Handle currency symbols, date/time separators, decimal formats
22- **Password Fields with Masking**: Show/hide characters with customizable delay
23- **Email and URL Validation**: Use RegEx patterns for complex validation
24- **Data Entry Forms**: Improve UX with guided input and instant feedback
25- **Accessibility Requirements**: Provide clear input expectations with prompts and validation
26
27## Component Overview
28
29**Key Capabilities:**
30- Two mask types: **Simple** (fixed patterns) and **RegEx** (flexible patterns)
31- Customizable prompt characters showing expected input positions
32- Flexible value formatting (include/exclude prompts and literals)
33- Real-time validation with multiple validation modes
34- Rich event system for monitoring and controlling input
35- Extensive customization (colors, fonts, borders, clear button)
36- Culture support for international formats
37- Password masking with visibility control
38- Modern Liquid Glass effect integration
39- Full accessibility and automation support
40
41## Documentation and Navigation Guide
42
43### Getting Started
44📄 **Read:** [references/getting-started.md](references/getting-started.md)
45- Installation and NuGet package setup
46- Handler registration in MauiProgram.cs
47- Basic MaskedEntry implementation
48- Setting mask patterns and types
49- Configuring prompt characters
50- Setting and retrieving values
51- First working example
52
53### Mask Types and Patterns
54📄 **Read:** [references/mask-types.md](references/mask-types.md)
55- Simple mask type and elements (0, 9, #, L, ?, C, A, <, >)
56- RegEx mask type and patterns
57- Complete element reference tables
58- Examples: phone numbers, dates, emails, product keys
59- Case conversion and special characters
60- When to use Simple vs RegEx
61- Performance considerations
62
63### Value Formatting and Display
64📄 **Read:** [references/value-formatting.md](references/value-formatting.md)
65- ValueMaskFormat options
66- ExcludePromptAndLiterals (typed only)
67- IncludePrompt (with prompt chars)
68- IncludeLiterals (with separators)
69- IncludePromptAndLiterals (all characters)
70- Use cases for data storage vs display
71- Visual comparisons and examples
72
73### Validation and Events
74📄 **Read:** [references/validation-and-events.md](references/validation-and-events.md)
75- ValidationMode (KeyPress, LostFocus)
76- HasError property for validation status
77- Focused/Unfocused events
78- Focus() and Unfocus() methods
79- ValueChanging event (cancelable, with IsValid, NewValue, OldValue, Cancel)
80- ValueChanged event (with IsMaskCompleted)
81- Completed event (return key)
82- ClearButtonClicked event
83- Event lifecycle and best practices
84
85### Customization and Styling
86📄 **Read:** [references/customization.md](references/customization.md)
87- Clear button configuration (visibility, color, custom path)
88- Font properties (size, attributes, family)
89- Text and placeholder styling
90- Border customization (stroke, visibility)
91- Background and transparency
92- Cursor position control
93- Keyboard configuration
94- SelectAllOnFocus behavior
95- IsReadOnly mode
96- Return key handling (ReturnType, ReturnCommand)
97- AutomationId support for UI testing
98- Platform-specific considerations
99
100### Advanced Features
101📄 **Read:** [references/advanced-features.md](references/advanced-features.md)
102- Culture support (currency, date/time separators, decimal/group separators)
103- HidePromptOnLeave for cleaner UI
104- Password masking (PasswordChar, PasswordDelayDuration)
105- Liquid Glass Effect integration
106- RTL support
107- Accessibility features
108- Performance optimization
109- Edge cases and troubleshooting
110