dot
Getting Started in Expression Blend


Microsoft® Expression® Studio is a suite of professional design tools for creating expressive user experiences while delivering great functionality for your clients across standards-based web sites, cross-platform Silverlight experiences and rich Windows applications. One of those tools is Expression Blend 3 which provides an interactive, aesthetic environment to create Silverlight and WPF applications. To get started, install Expression Blend 3 for a true visual design-time experience when building ArcGIS Silverlight or WPF applications. Use the tutorials and reference materials on the Expression Blend web site to develop your skillset.

The ArcGIS API for Microsoft Silverlight/WPF provides a set of integrated features in Expression Blend 3 which enable a developer to drag, drop, and interact with controls, actions and behaviors on an interactive design surface. A set of dialogs and property pages are included to design and configure components for Silverlight and WPF applications.

The following screenshot shows the areas of interest in the Expression Blend 3 IDE interface with respect to the ArcGIS Silverlight/WPF API . In general, controls, behaviors, and actions in the Core library and controls in the Toolkit library are included in the Assets list, the artboard provides an interactive surface to modify these controls at design time, and each ArcGIS control has a set of property dialogs, some of which are unique to the control. For example, the Map control has a Map Settings property panel in which you can set the initial extent, add layers, define resolution limits, etc. Also note, to modify some properties, click on the property peg next to the property name or setting.


overview


 

To begin working with the ArcGIS API for Silverlight/WPF in Expression Blend, follow these steps:



  1. Download and install the ArcGIS API for Microsoft Silverlight/WPF.

  2. In Expression Blend 3 create a Silverlight application project with host Web application (Silverlight 3 Application + Website).

  3. Show the Assets available in Expression Blend by clicking on the Assets button in the toolbar on the left side off the IDE. Under Controls select the ESRI collection. The core library contains two controls, Map and ScaleBar. Expand the Controls Expand the Assets dialog by clicking on the Assets Add a reference to the ESRI.ArcGIS.Client.dll in your Silverlight application project.

    assets

  4. Select the Map control and drag it onto the UserControl surface in the artboard. The Objects and Timeline tab will show the hierarchy of XAML contents (e.g. elements). Note that the Map control is in the Grid (LayoutRoot) which is in a UserControl. Make sure the Map control is selected in Objects and Timeline tab, then in the artboard use the mouse to resize the map to the size of the UserControl. In the Properties tab, under Layout, click the arrows icons next to the Width and Height attributes. This will enable automatic sizing of the Map control to it's container.

    resize map
  5. In Objects and Timeline, select the UserControl that contains the Map. In the Properties tab, under Layout click the arrows icons next to the Width and Height attributes. This will automatically adjust the size of the UserControl to the size specified in the page that hosts it. In the artboard you can use the design-time resizing handles to set the size of controls in design-view without changing runtime properties.

    resize container
  6. To add a layer to the map, click on the ellipsis next to the Layers property in the Map Settings property dialog. A Layer Collection Editor dialog will be displayed. To add a new item (layer) click the "Add another item" button. A Select Object dialog will display a list of layer types in the ArcGIS Silverlight/WPF API. Select ArcGISTiledMapServiceLayer to add a cached ArcGIS Server map service to the map and click OK.

    add layer

  7. A new ArcGISTiledMapServiceLayer will be added to the layers collection. A property page for the item will also be displayed. Click the arrow next to the Url property to open a property editor dialog which contains a Service Browser. The browser will enable you to add a ArcGIS Server REST catalog endpoint (e.g. http://serverapps.esri.com/arcgis/rest), browser cached map services, and define the service you want to use for your layer. A connection to ArcGIS Online (http://services.arcgisonline.com/arcgis/rest) is already provided via the "arcgis online" item. A preview window at the bottom of the Service Browser provides an interactive map that displays the selected service.

    Click OK to define the layer's Url property and close the Layer Collection Editor dialog.

    layer select

  8. Compile the code and run your application (press F5). Your Silverlight application will be hosted by an internal Web Development Server. The browser will open and the map will fill the browser window.

    If the map is blank, check the following:

    1. In order to access an ArcGIS Server site on a different domain than the Silverlight application host site, the ArcGIS Server site must enable remote access to services. This is accomplished using a clientaccesspolicy.xml or crossdomain.xml. In most cases, just place the xml file at the root of your Web site (e.g. for IIS, c:\inetpub\wwwroot\). Note, ArcGIS Online already hosts both files to support cross domain access for all Silverlight clients. See the FAQ topic in this help system for more details.

For more information

See the section about Maps and Layers for more information about the components presented in this quick tutorial.

To explore ArcGIS Silverlight components in action, see the SDK samples.

For tips on discovering ArcGIS Server map services, see Understanding ArcGIS Server.