corelibraries-devexpress-dot-utils-dot-commands-dot-command-654274bf.md
Creates an object defining the command state for the current command.
Namespace : DevExpress.Utils.Commands
Assembly : DevExpress.Data.v25.2.dll
NuGet Package : DevExpress.Data
public virtual ICommandUIState CreateDefaultCommandUIState()
Public Overridable Function CreateDefaultCommandUIState As ICommandUIState
| Type | Description |
|---|---|
| ICommandUIState |
An ICommandUIState interface that defines the command state.
|
Use the CreateDefaultCommandUIState method to create an object that exposes the ICommandUIState interface for a particular command. You can use the created object to obtain the current command state by calling the Command.UpdateUIState method. Then, you can check the command state and modify it if necessary, and call the Command.ForceExecute method to perform the action specified by the command.
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the CreateDefaultCommandUIState() method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
winforms-richeditcontrol-common-api/CS/RichEditAPISample/CodeExamples/RichEditControlActions.cs#L520
RichEditCommand capCommand = richEdit.CreateCommand(RichEditCommandId.CapitalizeEachWordTextCase);
capCommand.ForceExecute(capCommand.CreateDefaultCommandUIState());
winforms-richeditcontrol-common-api/VB/RichEditAPISample/CodeExamples/RichEditControlActions.vb#L529
Dim capCommand As RichEditCommand = richEdit.CreateCommand(RichEditCommandId.CapitalizeEachWordTextCase)
capCommand.ForceExecute(capCommand.CreateDefaultCommandUIState())
See Also