RelayCommandAttribute

Ecng.ComponentModel

Marks a method so the Ecng MVVM source generator emits a public command property ({Method}Command) wrapping it, producing Ecng commands (DelegateCommand / DelegateCommand for synchronous methods, AsyncCommand / AsyncCommand for Task-returning methods). The attribute name mirrors CommunityToolkit's for familiarity.

Наследует: Attribute

Свойства

AllowConcurrentExecutions
public bool AllowConcurrentExecutions { get; set; }
value = relayCommandAttribute.AllowConcurrentExecutions
relayCommandAttribute.AllowConcurrentExecutions = value

For asynchronous commands, allow more than one execution to run at the same time.

CanExecute
public string CanExecute { get; set; }
value = relayCommandAttribute.CanExecute
relayCommandAttribute.CanExecute = value

Name of a parameterless bool member (method or property) — or a bool method taking the command parameter — used as the command's CanExecute predicate.

IncludeCancelCommand
public bool IncludeCancelCommand { get; set; }
value = relayCommandAttribute.IncludeCancelCommand
relayCommandAttribute.IncludeCancelCommand = value

For asynchronous commands, also emit a {Method}CancelCommand property that cancels the running execution.