Adding Validation Logic for Your Actions
When creating a new action, there might be logic that you want executed to determine if that action should be enabled, disabled, or hidden in the user interface. You can write this logic in a class called a validator. See UI Validation for details about the validation service, writing a validator, and registering the validator for your action.