How to create a feature action

A custom feature action is a class in an add-in that implements the ESRI.ArcGIS.OperationsCenter.IFeatureAction interface. It must have an Export attribute with the value ESRI.ArcGIS.OperationsDashboard.FeatureAction. It should also have ExportMetadata attributes to set DisplayName, Description and ImagePath attributes.

The simplest way to create a new custom feature action is to use the Feature Action item template in Visual Studio for Operations Dashboard for ArcGIS.

Creating a new feature action

  1. Open an existing add-in project or create a new one by following the steps in the Getting started topic.
  2. Click Project -> Add New Item.

    The New Item dialog box appears with the list of installed templates.

  3. Navigate to Visual C# or Visual Basic > WPF > ArcGIS.
  4. Select the Operations Dashboard for ArcGIS Feature Action template, enter a Name, and click OK.

The following items are added to the project:

Essential elements of a feature action

The following essential elements of a feature action are automatically generated by the item template, with default values and implementation. Edits to these elements may be required when the default implementation is adapted.

Optional elements of a feature action

The additional areas of functionality can be implemented on a feature action, if the workflow being developed requires them.

Configuration

Some out-of-the-box feature actions are configurable–they allow the operation view author to alter how the feature action operations. For example, the highlight feature action allows the author to choose whether to zoom or pan to the feature in addition to highlighting it. However, configuration is optional.

To make a feature action configurable, return true from the IFeatureAction.CanConfigure method–the application will then show a configuration button next to the feature action in the list, allowing the author to change settings. If the CanConfigure method returns false, no configuration button is shown. See the API Reference help for other information on implementing the CanConfigure and Configure members of IFeatureAction.

Sending a feature to a widget

Some feature actions are used to send the geometry and attributes of a feature to a widget, to use as input to an operation the widget performs. For example, the Send to chat feature action sends the feature to the chat widget so it can be send to other users in a chat room.

A custom widget and feature action can work together in this way. The feature action can identify instances of the widget it works with by using the Widgets property of the OperationsDashboard class. If no instances are available, the feature action should return false from the CanExecute method. The widget can provide a public member to allow the feature action to pass the feature to the widget.

See the How to find a widget topic for more information on how to find a specific widget in the application.

1/27/2015