Back to Devexpress

InputChipGroup.Completed Event

mobilecontrols-devexpress-dot-xamarinforms-dot-editors-dot-inputchipgroup.md

latest1.9 KB
Original Source

InputChipGroup.Completed Event

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

Namespace : DevExpress.XamarinForms.Editors

Assembly : DevExpress.XamarinForms.Editors.dll

NuGet Package : DevExpress.XamarinForms.Editors

Declaration

csharp
public event CompletedEventHandler Completed

Event Data

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

PropertyDescription
ClearEditorTextGets 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.

cs
using Xamarin.Forms;
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

InputChipGroup Class

InputChipGroup Members

DevExpress.XamarinForms.Editors Namespace