UICommand Class
A ViewModel that is used to generate a dialog button.
Namespace: DevExpress.Mvvm
Assembly: DevExpress.Mvvm.v23.2.dll
NuGet Packages: DevExpress.Mvvm, DevExpress.Win.Navigation
Declaration
Related API Members
The following members return UICommand objects:
Show 13 links
Remarks
The code sample below shows how to define dialog buttons:
UICommand registerCommand = new UICommand(
id: null,
caption: "Register",
command: new DelegateCommand<CancelEventArgs>(
cancelArgs => {
try {
myExecuteMethod();
}
catch (Exception e) {
this.GetService<IMessageBoxService>().ShowMessage(e.Message, "Error", MessageButton.OK);
cancelArgs.Cancel = true;
}
},
cancelArgs => !string.IsNullOrEmpty(registrationViewModel.UserName)
),
isDefault: true,
isCancel: false
);
UICommand cancelCommand = new UICommand(
id: MessageBoxResult.Cancel,
caption: "Cancel",
command: null,
isDefault: false,
isCancel: true
);
IDialogService service = this.GetService<IDialogService>(serviceName);
UICommand result = service.ShowDialog(
dialogCommands: new[] { registerCommand, cancelCommand },
title: "Registration Dialog",
viewModel: detailViewModel
);
Inheritance
Object
BindableBase
UICommand
See Also