Skip to main content

InputChipGroup.Completed Event

Fires when a user presses Enter in the editor and allows you to create a chip.

Namespace: DevExpress.Maui.Editors

Assembly: DevExpress.Maui.Editors.dll

NuGet Package: DevExpress.Maui.Editors

Declaration

public event CompletedEventHandler Completed

Event Data

The Completed event's data class is CompletedEventArgs. The following properties provide information specific to this event:

Property Description
ClearEditorText Gets or sets whether to clear text in the editor after a chip is created.

Example

The code below shows how to create a chip based on user input.

using Microsoft.Maui.Controls;
using System.Collections.Generic;

public partial class MainPage : ContentPage {
    //...
    private void OnInputChipGroupCompleted(object sender, CompletedEventArgs e) {
        var chipGroup = sender as InputChipGroup;
        if (chipGroup.EditorText.Length <= 3) {
            e.ClearEditorText = false;
        } else {
            IList<ChipDataObject> list = chipGroup.ItemsSource as BindingList<ChipDataObject>;
            list.Add(new ChipDataObject() { Text = chipGroup.EditorText });
        }
    }
}

public class ChipDataObject {
    public string Text { get; set; }
}
See Also