Extending ArcGIS® Pro with Add-ins

STUDENT EDITION Copyright © 2017

All rights reserved.

Course version 2.0. Version release date August 2017.

Printed in the United States of America.

The information contained in this document is the exclusive property of Esri. This work is protected under United States copyright law and other international copyright treaties and conventions. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying and recording, or by any information storage or retrieval system, except as expressly permitted in writing by Esri. All requests should be sent to Attention: Contracts and Legal Services Manager, Esri, 380 New York Street, Redlands, CA 92373-8100 USA.

EXPORT NOTICE: Use of these Materials is subject to U.S. export control laws and regulations including the U.S. Department of Commerce Export Administration Regulations (EAR). Diversion of these Materials contrary to U.S. law is prohibited.

The information contained in this document is subject to change without notice.

US Government Restricted/Limited Rights

Any , documentation, and/or data delivered hereunder is subject to the terms of the License Agreement. The commercial license rights in the License Agreement strictly govern Licensee's use, reproduction, or disclosure of the software, data, and documentation. In no event shall the US Government acquire greater than RESTRICTED/LIMITED RIGHTS. At a minimum, use, duplication, or disclosure by the US Government is subject to restrictions as set forth in FAR §52.227-14 Alternates I, II, and III (DEC 2007); FAR §52.227-19(b) (DEC 2007) and/or FAR §12.211/12.212 (Commercial Technical Data/Computer Software); and DFARS §252.227-7015 (DEC 2011) (Technical Data - Commercial Items) and/or DFARS §227.7202 (Commercial Computer Software and Commercial Computer Software Documentation), as applicable. Contractor/Manufacturer is Esri, 380 New York Street, Redlands, CA 92373-8100, USA.

@esri.com, 3D Analyst, ACORN, Address Coder, ADF, AML, ArcAtlas, ArcCAD, ArcCatalog, ArcCOGO, ArcData, ArcDoc, ArcEdit, ArcEditor, ArcEurope, ArcExplorer, ArcExpress, ArcGIS, ArcGlobe, ArcGrid, ArcIMS, ARC/INFO, ArcInfo, ArcInfo Librarian, ArcLessons, ArcLocation, ArcLogistics, ArcMap, ArcNetwork, ArcNews, ArcObjects, ArcOpen, ArcPad, ArcPlot, ArcPress, ArcPy, ArcReader, ArcScan, ArcScene, ArcSchool, ArcScripts, ArcSDE, ArcSdl, ArcSketch, ArcStorm, ArcSurvey, ArcTIN, ArcToolbox, ArcTools, ArcUSA, ArcUser, ArcView, ArcVoyager, ArcWatch, ArcWeb, ArcWorld, ArcXML, Atlas GIS, AtlasWare, Avenue, BAO, Business Analyst, Business Analyst Online, BusinessMAP, CityEngine, CommunityInfo, Integrator, DBI Kit, EDN, Esri, Esri—Team GIS, Esri—The GIS Company, Esri—The GIS People, Esri—The GIS Software Leader, FormEdit, GeoCollector, Geographic Design System, Geography Matters, Geography Network, GIS by Esri, GIS Day, GIS for Everyone, GISData Server, JTX, MapIt, Maplex, MapObjects, MapStudio, ModelBuilder, MOLE, MPS—Atlas, PLTS, Rent-a-Tech, SDE, SML, Sourcebook·America, SpatiaLABS, Engine, StreetMap, Tapestry, the ARC/INFO logo, the ArcGIS logo, the ArcGIS Explorer logo, the ArcPad logo, the Esri globe logo, the Esri Press logo, the GIS Day logo, the MapIt logo, The Geographic Advantage, The Geographic Approach, The World's Leading Desktop GIS, Water Writes, www..com, www.esri.com, www.geographynetwork.com, www.gis.com, www.gisday.com, and Your Personal Geographic Information System are trademarks, service marks, or registered marks in the United States, the European Community, or certain other jurisdictions. CityEngine is a registered trademark of Procedural AG and is distributed under license by Esri.

Other companies and products or services mentioned herein may be trademarks, service marks or registered marks of their respective mark owners. Table of Contents

Esri resources for your organization Course introduction

Course introduction Course goals Installing the course data Training Services account credentials Icons used in this workbook Understanding the ArcGIS platform 1 Introduction to the ArcGIS Pro SDK

Lesson introduction Customization strategies for ArcGIS Pro Exploring ArcGIS Pro SDK documentation and help resources .NET add-ins Using a sample to build an add-in Exercise 1: Build an add-in using a sample Download ArcGIS Pro Community samples Build and test an add-in Remove the add-in using the Add-In Manager Lesson review Answers to Lesson 1 questions 2 Working with DAML

Lesson introduction How can the ArcGIS Pro ribbon be customized? Using the ArcGIS Pro SDK and DAML to customize controls Creating an add-in with custom and existing ArcGIS Pro controls Exercise 2: Customize the ArcGIS Pro ribbon Create an ArcGIS Pro Module Add-in project Customize the ArcGIS Pro ribbon with a new tab Add core ArcGIS Pro commands to a tab Modify the core Map tab Remove the add-in Exercise review Lesson review

i Answers to Lesson 2 questions 3 Implementing states and conditions

Lesson introduction Implementing states and conditions Using states and conditions to control visibility Exercise 3: Change control visibility using states and conditions Open an existing project Define a custom state and condition Add a button to toggle the state Implement a Delegate command Exercise review Lesson review Answers to Lesson 3 questions 4 Executing asynchronous and synchronous methods

Lesson introduction ArcGIS Pro threading model Coarse- and fine-grained methods Creating asynchronous utility methods Exercise 4: Use coarse- and fine-grained functions Open an existing project Select features using a coarse-grained function Zoom to selected features using a coarse-grained function Select features and zoom using a fine-grained function Exercise review Lesson review Answers to Lesson 4 questions 5 Creating a dockpane with ArcGIS Pro commands

Lesson introduction Creating a dockpane using an item template ArcGIS Pro MVVM pattern Hooking ArcGIS Pro commands Exercise 5: Customize a dockpane Open an existing project Hook existing ArcGIS Pro commands Populate the feature layer drop-down list Synchronize the UI with data updated by a worker thread Fill the data grid with selected records Flash the feature for the current selected row on the data grid

ii Exercise review Lesson review Answers to Lesson 5 questions 6 Working with project items

Lesson introduction Working with projects Project items Opening a map and adding a folder connection to the project Exercise 6: Work with project items Add a folder connection to the project Add a new dockpane to the add-in Update the dockpane View and ViewModel Import the selected MXD file Exercise review Lesson review Answers to Lesson 6 questions 7 Working with portal items

Lesson introduction Working with a portal Searching a portal for items Using EsriHttpClient Exercise 7: Add a layer from a portal to a map Search for portal items using EsriHttpClient Add item results to a dynamic list Create a layer from an item result and add it to the map Run the add-in Exercise review Lesson review Answers to Lesson 7 questions 8 Interacting with the map view

Lesson introduction Understanding the map view Navigating the map view using the camera Creating a map tool Exercise 8: Create a map tool to interact with the map view Add a custom map tool using an item template Implement the custom map tool Display identify results in an overlay control

iii Select and zoom to features Exercise review Lesson review Answers to Lesson 8 questions 9 Working with layers and renderers

Lesson introduction Applying a renderer to a layer Providing symbols and defining a enderr er for a layer Displaying pop-ups for a layer Exercise 9: Apply symbols using layer and renderer definitions Examine the symbol picker Get styles for the current project Display symbols that match search criteria Apply the symbol to the selected layers in the map Exercise review Lesson review Answers to Lesson 9 questions 10 Working with geodatabase features

Lesson introduction Accessing content in a geodatabase Exercise 10A: Access a feature class in the geodatabase Add a feature class to a map Add a feature class to a map as a layer Querying features Adding attachments to features Exercise 10B: Add image attachments to geodatabase features Retrieve features Add attachments to features Exercise review Lesson review Answers to Lesson 10 questions 11 Editing features

Lesson introduction Implementing editing tools Creating edit operations Adding edit tools to the ArcGIS Pro UI Exercise 11: Create an edit tool Use the Map Tool item template to create an edit tool

iv Use edit operations Use the GeometryEngine to rotate features Add the edit tool to the Editor tools gallery and Modify Features dockpane Exercise review Lesson review Answers to Lesson 11 questions 12 ArcGIS Pro configurations

Lesson introduction Understanding configurations Deploying and using configurations Lesson review Appendices

Appendix A: Esri data license agreement Appendix B: Answers to lesson review questions Appendix C: Additional resources Appendix D: Lesson stories

v