Editor

The Editor control is used to accept multi-line input by exposing the Text property.


        <Editor x:Name="myEditor"
        Text="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
        TextChanged="OnTextChanged" />
                

Code Behind

A TextChanged event is raised whenever the text in the editor changes.


                    void OnTextChanged(object sender, EventArgs e)
                    {
                        var text = ((Editor)sender).Text;
                        Console.WriteLine(text);
                    }
                

A Completed event is raised when input has ended by pressing on the keyboard return key.


        <Editor x:Name="myEditor"
        Text="Lorem ipsum dolor sit amet."
        Completed="OnTextCompleted" />
                

Limiting the length of Editor

The length of the Editor can be limited by specifying the MaxLength property.


        <Editor x:Name="myEditor"
        Text="Lorem ipsum dolor sit amet."
        MaxLength="500" />
                

Keyboard Property

The keyboard presented for interaction with Editor can be set to the following type:

Default, Chat (with emoji), Email, Numeric, Plain, Telephone, Text, and Url


        <Editor x:Name="myEditor"
        Text="Lorem ipsum dolor sit amet."
        Keyboard="Numeric" />
                

Download

.NET MAUI