ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Desktop.Framework Namespace / RelayCommand Class

In This Topic
    RelayCommand Class
    In This Topic
    An implementation of ICommand.

    RelayCommands are helpful in decoupling the user interface from the logic that needs to run when a button is clicked for example.

    The framework's RelayCommand implementation is special in that by default it will add the command to the application's main message pump meaning its CanExecute function will automatically be called several times a second. If you do not need this behavior, set supportsOnUpdate to false in the appropriate constructor. If you do use this behavior, make sure you Disconnect the command from the pump when your dialog closes.

    RelayCommands automatically disable whenever the primary worker thread is busy. To override this behavior set disableWhenBusy to false in the appropriate constructor.

    Note, RelayCommands in the message pump automatically disable once the application begins to shutdown.

    Inheritance Hierarchy



    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also