# .NET MAUI Editor Events

The Telerik UI for .NET MAUI Editor control exposes a number of events and commands for notifying after user interactions.

The Editor supports the following events:

* `TextChanged`—Occurs when the text is changed. The `TextChanged` event handler receives a `TextChangedEventArgs` argument containing data related to this event. The `TextChangedEventArgs` provides the following properties:
  * `NewTextValue` (`string)`—Gets the new text value.
  * `OldTextValue` (`string)`—Gets the old text value.

* `TextChanging`—Occurs when the text in the control starts to change, but before the `Text` property is updated. The `TextChanging` event handler receives a `TextChangingEventArgs` argument containing data related to this event. The `TextChangedEventArgs` provides the following properties:
  * `NewText` (`string`)—Gets the new text that is about to be entered into the input view.
  * `OldText` (`string`)—Gets the old text that is entered into the input view.
  * `Cancel` (`bool`)—Gets or sets a value that indicates whether to cancel the text changes.

* `Completed`—Occurs when the user finalizes the text.

The `Completed` event is raised when the Editor control losses focus.

The following example demonstrates the Editor definition in XAML with the `TextChanged` and `Completed` event handlers.

**1.** Define the Editor.

```XAML
        <telerik:RadEditor TextChanging="OnTextChanging"
             Completed="OnCompleted" />
```

**2.** Add the following namespace:

```XAML
xmlns:telerik="http://schemas.telerik.com/2022/xaml/maui"
```

**3.** Set the `TextChanging` event.

```C#
private void OnTextChanging(object sender, Telerik.Maui.Controls.TextChangingEventArgs e)
{
    this.eventLabel.Text = $"Text changing from '{e.OldText}' to '{e.NewText}'";
}
```

**3.** Set the `Completed` event.

```C#
private void OnCompleted(object sender, System.EventArgs e)
{
    var editor = sender as RadEditor;
    if (editor.Text is not null)
    {
        editor.Text = string.Empty;
        this.eventLabel.Text = string.Empty;
    }
}
```

![Editor Events](https://www.telerik.com/maui-ui/documentation/assets/57b0b37a8ce07ef85dd93cd8c972a243/editor-events.gif)

## See Also

* [Text Appearance](https://www.telerik.com/maui-ui/documentation/controls/editor/text-appearance)
* [Text Selection](https://www.telerik.com/maui-ui/documentation/controls/editor/text-selection)
* [Styling](https://www.telerik.com/maui-ui/documentation/controls/editor/styling)
* [Validation](https://www.telerik.com/maui-ui/documentation/controls/editor/validation)
* [Visual States](https://www.telerik.com/maui-ui/documentation/controls/editor/visual-states)
