Back to Devexpress

RecentItemBase.BindCommand<T>(Expression<Action<T>>, Object, Func<T>) Method

windowsforms-devexpress-dot-xtrabars-dot-ribbon-dot-recentitembase-dot-bindcommand-1-x28-system-dot-linq-dot-expressions-dot-expression-system-dot-action-0-system-dot-object-system-dot-func-0-x29.md

latest2.9 KB
Original Source

RecentItemBase.BindCommand<T>(Expression<Action<T>>, Object, Func<T>) Method

Uses the command selector to find an appropriate parameterized command of the target type in the source and bind it to this RecentItemBase class descendant.

Namespace : DevExpress.XtraBars.Ribbon

Assembly : DevExpress.XtraBars.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
public IDisposable BindCommand<T>(
    Expression<Action<T>> commandSelector,
    object source,
    Func<T> queryCommandParameter = null
)
vb
Public Function BindCommand(Of T)(
    commandSelector As Expression(Of Action(Of T)),
    source As Object,
    queryCommandParameter As Func(Of T) = Nothing
) As IDisposable

Parameters

NameTypeDescription
commandSelectorExpression<Action<T>>

An Expression that selects the appropriate command from the source object.

| | source | Object |

An Object (typically, a ViewModel) where the commandSelector looks for the required command.

|

Optional Parameters

NameTypeDefaultDescription
queryCommandParameterFunc<T>null

A Func delegate that passes the specific Object to the command as a parameter.

|

Type Parameters

NameDescription
T

The type of a ViewModel that stores a bindable command.

|

Returns

TypeDescription
IDisposable

An IDisposable object. Disposing of this object unbinds the command.

|

Remarks

The BindCommand method supports the WinForms MVVM pattern. See the Commands topic to learn more.

See Also

RecentItemBase Class

RecentItemBase Members

DevExpress.XtraBars.Ribbon Namespace