Customizing a pop-up menu when a feature is activated from a list

Within the mobile application, pop-up menus are used to provide a specific set of operations to the user when a choice is required. Very often the menu will show a collection of operations that you can apply to the selected feature, for example, Browse on Map, View Attributes, Edit Attributes, Delete, Add to WorkList, Cancel, and so on. This presents the user a similar experience as the Context menu in the Windows platform.

To create your own customized pop-up menu, application framework exposes an extensible point that you can use. Each menu item on the pop-up menu is called a FeatureActionItem, representing an Action that you can apply to a feature. Whenever a project is creating a list of FeatureActionItems, it fires an event called CreatingFeatureActionItems. By listening to this event, you have the opportunity to customize the list of FeatureActionItems appearing on the pop-up menu. This event is fired when the Project is constructing a list of FeatureActionItems. This can happen on other pages as well, such as FeatureListPage, IdentifyResultsPage, SearchResultsPage, and so on.

Therefore, if you subscribe to the Project.CreatingFeatureActionItems event and customize the menu, it will be effective for any page where Project constructs a list of FeatureActionItems. To customize the pop-up menu for a specific type of page, you need to check the Context in which the event gets fired.

Through FeatureActionEventArgs, you can get a list of ActionItems through the ActionItems property, and add a new FeatureActionItem or remove an existing FeatureActionItem. The Context property allows you to check the type of IPage from which this event is fired, and you can get access to the selected feature through SelectedFeature.

1/7/2015