Skip to main content

SlideViewItem.Command Property

Gets or sets a command executed when the SlideViewItem‘s header is clicked.

Namespace: DevExpress.Xpf.WindowsUI

Assembly: DevExpress.Xpf.Controls.v21.2.dll

Declaration

public ICommand Command { get; set; }

Property Value

Type Description
ICommand

An object that implements the ICommand interface, executed when the SlideViewItem‘s header is clicked.

Remarks

You can assign any ICommand interface implementation to a SlideViewItem. This command will be executed after an end-user clicks this item’s header (this also raises the SlideViewItem.Click event for this item and the SlideView.ItemClick event for the entire SlideView). The following code illustrates how to use a DelegateCommand object as the SlideViewItem‘s command.

public slideView() {
    InitializeComponent();
    DevExpress.Xpf.WindowsUI.Base.DelegateCommand myCommand = new DevExpress.Xpf.WindowsUI.Base.DelegateCommand(executeFunc, canExecuteFunc);
    slideViewItem1.Command = myCommand;
}

//a function that checks specific conditions and determines whether our custom command can be executed in its current state
private bool canExecuteFunc() {
    if (. . .) return true;
    else return false;
}

//a function that performs specific actions
private void executeFunc() {
    . . .
}

You can also pass a required object to the SlideViewItem command via the SlideViewItem.CommandParameter property.

See Also