Open sandboxFocus

Class CommandAttribute

Inheritance
CommandAttribute
Namespace: Metalama.Patterns.Wpf
Assembly: Metalama.Patterns.Wpf.dll
Syntax
[AttributeUsage(AttributeTargets.Method)]
public sealed class CommandAttribute : Attribute, IAspect<IMethod>, IAspect, ICompileTimeSerializable, ITemplateProvider, IEligible<IMethod>

Constructors

Name Description
CommandAttribute()

Properties

Name Description
Background

Gets or sets a value indicating whether the command will execute in a background thread. The default value is false, meaning that the command will be executed in the UI thread. If this property is set to true, a property of type AsyncDelegateCommand is generated, even for non-Task execution methods.

CanExecuteMethod

Gets or sets the name of the method that is called to determine whether the command can be executed. This method corresponds to the CanExecute(object) method.

CanExecuteProperty

Gets or sets the name of the property that is evaluated to determine whether the command can be executed. This property corresponds to the CanExecute(object) method.

CommandPropertyName

Gets or sets the name of the ICommand property that is introduced.

EnableINotifyPropertyChangedIntegration

Gets or sets a value indicating whether integration with INotifyPropertyChanged is enabled. The default is true.

SupportsConcurrentExecution

Gets or sets a value indicating whether several executions of the command can run concurrently. This property is only considered for asynchronous methods. Its default value is false, which means that the CanExecute(object) method will return false if another execution is still running. This property is ignored if the execution method is non-Task and the Background property is left to false.

Extension Methods