Extending the ArcGIS Viewer for Silverlight
Add-ins and the Extensibility API
The ArcGIS Viewer for Silverlight allows you to develop custom functionality by creating add-ins. Add-ins are Silverlight assemblies that contain one or more tools or map behaviors that interact with the Viewer. To help you write add-ins, the Viewer provides a lightweight and flexible extensibility application programming interface (API) included in the ArcGIS Extensibility SDK for Silverlight. The API provides Viewer developers access to the map and selected layer, methods to show user interfaces (UI) in dialog boxes, and the ability to store and load configuration data. All the functionality exposed by the extensibility API is available in the ESRI.ArcGIS.Client.Extensibility assembly. To take advantage of this functionality, add a reference to this assembly to your Visual Studio project.
Once you have written an add-in, add the compiled Silverlight Application (.xap file) to the Application Builder using the Settings page, then when creating or editing your Viewer application, you can add the tools and behaviors contained in your add-in through the Add Tool and Manage dialog boxes. See Adding and managing tools and toolbars. Tools that are added are surfaced as buttons on the toolbar. Behaviors that are added are enabled when the Viewer loads and can be managed through the Map Behaviors dialog box.
To add an add-in to the Viewer, see the following steps:
- Create your add-in, referencing the Creating a tool and Creating a map behavior topics as needed.
- Open the Application Builder and open a saved Viewer application or create a new one.
- Click Settings in the upper-right corner.
- On the Settings page, click the Add-Ins tab.
- Click Upload Add-Ins, navigate to your compiled Silverlight Application (.xap file), and click Open.
- The add-in is added to the Application Builder. Click the name of the add-in or the Details button to see the add-ins included in the add-in package you have uploaded.
- Click the Back button in the upper-right corner to return to the Application Builder.
This help system includes a series of topics on best practices for developing add-ins for the ArcGIS Viewer for Silverlight. These topics include subjects such as determining whether to develop a tool or behavior, design of dialog boxes and UI, how to handle map interaction such as mouse clicks, symbolizing and rendering graphics layers, and creating add-ins that can be configured. Please see the following topics: