Back to Devexpress

FormItemBase.TapCommand Property

maui-devexpress-dot-maui-dot-editors-dot-formitembase-49e5cafe.md

latest2.1 KB
Original Source

FormItemBase.TapCommand Property

Gets or sets a command executed when a user taps the form item. This is a bindable property.

Namespace : DevExpress.Maui.Editors

Assembly : DevExpress.Maui.Editors.dll

NuGet Package : DevExpress.Maui.Editors

Declaration

csharp
public ICommand TapCommand { get; set; }

Property Value

TypeDescription
ICommand

A command that exposes the ICommand interface.

|

Remarks

For more information about using commands in MAUI, refer to the following page: Commanding.

As an alternative to the TapCommand, you can handle the form item’s Tap event to process user taps.

Example

The following example executes a command when a user taps a form item:

xaml
<dxe:FormItem ...
              AllowTap="True"
              TapCommand="{Binding OnTapCommand}">
csharp
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Windows.Input;

namespace FormItemsTestApp;

public partial class MainPage : ContentPage {
    public MainPage() {
        InitializeComponent();
        this.BindingContext = new MainPageViewModel();
    }
}

public class MainPageViewModel {
    //...
    public ICommand OnTapCommand => new Command(OnFormItemTap);
    private void OnFormItemTap() {
        // Perform actions when the form item is tapped.
        // ...
    }

}

See Also

FormItemBase Class

FormItemBase Members

DevExpress.Maui.Editors Namespace