Skip to main content
A newer version of this page is available. .

CommandAttribute.UseCommandManager Property

Gets or sets whether to use a function that manages the command execution.

Namespace: DevExpress.Mvvm.DataAnnotations

Assembly: DevExpress.Mvvm.v18.2.dll

Declaration

public bool UseCommandManager { get; set; }

Property Value

Type Description
Boolean

true, to use the command manager; otherwise, false.

Remarks

If the UseCommandManager property is set to true, a function whose name is specified by the CommandAttribute.CanExecuteMethodName property manages whether the command can be executed.

See the example below:


public class LoginViewModel {
        [Command(CanExecuteMethodName = "CanSaveAccountSettings",
            Name = "SaveCommand",
            UseCommandManager = true)]
        public void SaveAccountSettings(string fileName) {
            //... 
        }
        public bool CanSaveAccountSettings(string fileName) {
            return !string.IsNullOrEmpty(fileName);
        }
    }
See Also