arcgis pro sdk for .net: introduction to …...•develop pro add-ins which allow extending and...

28
Christopher Zent ArcGIS Pro SDK for .NET: Introduction to Customization and Extensibility

Upload: others

Post on 25-Aug-2020

10 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ArcGIS Pro SDK for .NET: Introduction to …...•Develop Pro add-ins which allow extending and customizing of Pro • Microsoft Visual Studio 2017 & 2019 –code in C# or VB.NET •

Christopher Zent

ArcGIS Pro SDK for .NET: Introduction to Customization and Extensibility

Page 2: ArcGIS Pro SDK for .NET: Introduction to …...•Develop Pro add-ins which allow extending and customizing of Pro • Microsoft Visual Studio 2017 & 2019 –code in C# or VB.NET •

Session Overview

• SDK overview

• DAML – Declarative Application Markup Language

• Developing with Pro’s extensibility patterns- Add-Ins

- Configurations

- Plug-in datasources

- CoreHost applications

Page 3: ArcGIS Pro SDK for .NET: Introduction to …...•Develop Pro add-ins which allow extending and customizing of Pro • Microsoft Visual Studio 2017 & 2019 –code in C# or VB.NET •

ArcGIS Pro SDK Overview

Page 4: ArcGIS Pro SDK for .NET: Introduction to …...•Develop Pro add-ins which allow extending and customizing of Pro • Microsoft Visual Studio 2017 & 2019 –code in C# or VB.NET •

ArcGIS Pro SDK for Microsoft .NET

• Develop Pro add-ins which allow extending and customizing of Pro

• Microsoft Visual Studio 2017 & 2019 – code in C# or VB.NET

• Templates and tools streamline add-in development

• Modern framework using .NET – WPF, MVVM, LINQ, etc.

• ArcGIS Pro APIs come with ArcGIS Pro out-of-box

• Asynchronous – work with multiple threads

Project Templates

Item Templates

Page 5: ArcGIS Pro SDK for .NET: Introduction to …...•Develop Pro add-ins which allow extending and customizing of Pro • Microsoft Visual Studio 2017 & 2019 –code in C# or VB.NET •

Pro Add-Ins – Built with the Pro SDK

• Two main patterns:- Add-Ins – Develop new tools and functionality, and customize UI- Configurations – Deeper customization, branding, start-up experience, streamline UITwo additional patterns:- Plug-in datasources – Make a custom data source available for use in the Pro UI- CoreHost applications – Standalone apps with limited API access

-

Animated Symbols Add-In ArcGIS Pro for Intelligence Solution

Page 6: ArcGIS Pro SDK for .NET: Introduction to …...•Develop Pro add-ins which allow extending and customizing of Pro • Microsoft Visual Studio 2017 & 2019 –code in C# or VB.NET •

How does a Pro add-in work?

• Extends ArcGIS Pro through:- Pro buttons, tools, dockpanes, controls, etc.- Custom functionality you create with Pro APIs

• Packaged within a single, compressed file with an .esriaddinX file extension

- C:\Users\<UserName>\Documents\ArcGIS\AddIns\ArcGISPro

• As Pro starts, it looks for add-ins placed in well-known folders and loads them

Page 7: ArcGIS Pro SDK for .NET: Introduction to …...•Develop Pro add-ins which allow extending and customizing of Pro • Microsoft Visual Studio 2017 & 2019 –code in C# or VB.NET •

Core Components

• Config.daml- DAML – Desktop Application Markup Language- XML format, declarative-based framework to define the UI elements - Contains ArcGIS Pro framework elements (buttons, dockpane, galleries) and add-in UI elements

• The Module class- Hub and central access point for a subsystem- Similar to the Extension object used in the ArcObjects 10.x framework

Page 8: ArcGIS Pro SDK for .NET: Introduction to …...•Develop Pro add-ins which allow extending and customizing of Pro • Microsoft Visual Studio 2017 & 2019 –code in C# or VB.NET •

Samples and Documentation

• Documentation and tutorials • Over 175 community samples available• SDK releases are in sync with ArcGIS Pro

Realtime Stream Layers API

Scene Layers API

Map Exploration API

Page 9: ArcGIS Pro SDK for .NET: Introduction to …...•Develop Pro add-ins which allow extending and customizing of Pro • Microsoft Visual Studio 2017 & 2019 –code in C# or VB.NET •

Demo: Building an Add-in

Page 10: ArcGIS Pro SDK for .NET: Introduction to …...•Develop Pro add-ins which allow extending and customizing of Pro • Microsoft Visual Studio 2017 & 2019 –code in C# or VB.NET •

<ArcGIS defaultAssembly="WorkingWithDAML.dll" defaultNamespace="WorkingWithDAML"xmlns="http://schemas.esri.com/DADF/Registry"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://schemas.esri.com/DADF/Registryfile:///C:/Program%20Files/ArcGIS/Pro/bin/ArcGIS.Desktop.Framework.xsd">

<AddInInfo id="{c6226a24-d69b-46c6-b5e7-9eee4ddad45d}" version="1.0" desktopVersion="1.1.2850">…</AddInInfo><modules>

<insertModule id="WorkingWithDAML" className="Module1" autoLoad="false" caption="Module1"><tabGroups>

<!--The new Tab Group is created here--><tabGroup caption="Example State Solution" id="working_with_DAML_ExampleStateTabGroup">

<color A="255" R="238" G="170" B="90" /><borderColor A="0" R="251" G="226" B="195" />

</tabGroup></tabGroups>

Declarative Markup for Pro UI Elements: DAML• Add-ins use “Declarative Markup” (DAML) language for UI Elements

- Buttons, Dockpane, Galleries, Property Sheets, Tools, …

• DAML uses XML Syntax - stored in a Config.daml file• Using DAML, you can add, modify, delete any User Interface element • Pro also uses DAML: <Install Location>\bin\Extensions folder

Page 11: ArcGIS Pro SDK for .NET: Introduction to …...•Develop Pro add-ins which allow extending and customizing of Pro • Microsoft Visual Studio 2017 & 2019 –code in C# or VB.NET •

• DAML is transactional and is processed in the order the Pro Extension or Add-in is loaded- 3 distinct actions: Insert, Update, and Delete- The type of action is determined by the element name: updateModule, updateGroup, deleteButton

<updateModule refID="esri_mapping"><groups>

<updateGroup refID="esri_mapping_navigateGroup"><deleteButton refID="esri_mapping_bookmarksNavigateGallery“ /><insertButton refID="working_with_DAML_ToggleStateButton" />

</updateGroup></groups>

</updateModule>

In the DAML transactional model –the ‘last’ transaction wins

Declarative Markup for Pro UI Elements: DAML

Page 12: ArcGIS Pro SDK for .NET: Introduction to …...•Develop Pro add-ins which allow extending and customizing of Pro • Microsoft Visual Studio 2017 & 2019 –code in C# or VB.NET •

How to use existing Pro UI elements in Your Add-in

• Use any existing ArcGIS Pro framework elements on your Add-in tab including Buttons, Tools, Galleries• Find the Unique Element Id of any existing ArcGIS Pro Control and use the Id in your config.daml markup

to add, delete, modify that Element• Example: Add Pro’s Navigate Bookmarks button to my Add-in toolbar

- button tag references existing Element ID: esri_mapping_bookmarksNavigateGallery

<group id="HookingCommands_Group1" caption="Hooking Commands" keytip="G1"><button refID="esri_mapping_bookmarksNavigateGallery" />

</group>

Page 13: ArcGIS Pro SDK for .NET: Introduction to …...•Develop Pro add-ins which allow extending and customizing of Pro • Microsoft Visual Studio 2017 & 2019 –code in C# or VB.NET •

How to find Pro Element DAML IDs• SDK Help: ArcGIS Pro DAML ID Reference

https://github.com/Esri/arcgis-pro-sdk/wiki/ArcGIS-Pro-DAML-ID-Reference• Pro Generate DAML IDs tool in Visual Studio

- Allows IntelliSense to find IDs:i.e. DAML.Button.esri_mapping_addDataButton

- ArcGIS Pro ‘Customize the Ribbon’: Show IDs option

Page 14: ArcGIS Pro SDK for .NET: Introduction to …...•Develop Pro add-ins which allow extending and customizing of Pro • Microsoft Visual Studio 2017 & 2019 –code in C# or VB.NET •

WorkingWithDAML Framework Sample

Demo: Add-in using ArcGIS Pro Buttons, States & Conditions

Page 15: ArcGIS Pro SDK for .NET: Introduction to …...•Develop Pro add-ins which allow extending and customizing of Pro • Microsoft Visual Studio 2017 & 2019 –code in C# or VB.NET •

ArcGIS Pro Managed Configuration• Includes all functionality of an add-in plus

- Change the application title and icon- Change the application splash, start page, and about page- Optionally customize and streamline the UI (the Pro Ribbon) for a specific workflow

• Packaged within a single, compressed file with a .ProConfigX file extension:C:%Homepath%\Documents\ArcGIS\AddIns\ArcGISPro\Configurations

Default start page Custom start page

Page 16: ArcGIS Pro SDK for .NET: Introduction to …...•Develop Pro add-ins which allow extending and customizing of Pro • Microsoft Visual Studio 2017 & 2019 –code in C# or VB.NET •

ArcGIS Pro Managed Configuration

• Running an ArcGIS Pro Managed Configuration- Use the ArcGIS Pro “/config” command-line option

- Only one configuration can run per instance of Pro

• ConfigurationManager class - Defined in DAML (generated automatically by the template)- Provides a set of methods by which a developer can override “that” aspect of Pro

public abstract class ConfigurationManager {protected internal virtual Window OnShowSplashScreen();protected internal virtual FrameworkElement OnShowStartPage();protected internal virtual FrameworkElement OnShowAboutPage();...

C:\ArcGIS\bin\ArcGISPro.exe /config:Acme

Page 17: ArcGIS Pro SDK for .NET: Introduction to …...•Develop Pro add-ins which allow extending and customizing of Pro • Microsoft Visual Studio 2017 & 2019 –code in C# or VB.NET •

Demo: Configurations

Page 18: ArcGIS Pro SDK for .NET: Introduction to …...•Develop Pro add-ins which allow extending and customizing of Pro • Microsoft Visual Studio 2017 & 2019 –code in C# or VB.NET •

ArcGIS Pro CoreHost Application

• Stand-alone application with a subset of Pro Assemblies- ArcGIS.CoreHost assembly – API to manage CoreHost functions- ArcGIS.Core assembly – Includes Geodatabase and Geometry classes

• CoreHost Applications have limited access - Geodatabase classes - Geometry classes

• CoreHost Application options

- Windows Console application - WPF application

Page 19: ArcGIS Pro SDK for .NET: Introduction to …...•Develop Pro add-ins which allow extending and customizing of Pro • Microsoft Visual Studio 2017 & 2019 –code in C# or VB.NET •

C:\Data\Admin\AdminData.gdb

Demo: CoreHost GDBSample

Page 20: ArcGIS Pro SDK for .NET: Introduction to …...•Develop Pro add-ins which allow extending and customizing of Pro • Microsoft Visual Studio 2017 & 2019 –code in C# or VB.NET •

ArcGIS Pro Plugin Datasource

• The Plugin Datasource framework allows developers to make custom datasources available for use in Pro

- Access in Pro is read-only- Access is in form of tables or feature classes- Access is file based (my data source is a file)

• Examples of custom data sources – Image files, GPS data, proprietary file formats

Page 21: ArcGIS Pro SDK for .NET: Introduction to …...•Develop Pro add-ins which allow extending and customizing of Pro • Microsoft Visual Studio 2017 & 2019 –code in C# or VB.NET •

ArcGIS Pro Plugin Datasource

• ArcGIS Pro supports data from a large variety of data sources and formats from shape files to Oracle databases

• Plugin Datasources allow access to other data sources like relational databases such as MySQL, non-relational databases such as MongoDB, and a myriad of other proprietary and file-based data stores

Page 22: ArcGIS Pro SDK for .NET: Introduction to …...•Develop Pro add-ins which allow extending and customizing of Pro • Microsoft Visual Studio 2017 & 2019 –code in C# or VB.NET •

Demo: ProDataReaderSample

Page 23: ArcGIS Pro SDK for .NET: Introduction to …...•Develop Pro add-ins which allow extending and customizing of Pro • Microsoft Visual Studio 2017 & 2019 –code in C# or VB.NET •

Pro SDK Resources

• Landing Page – Main resource page - https://pro.arcgis.com/en/pro-app/sdk/

• Links to:- API Reference, Samples and Documentation

- ArcGIS Tutorials

- ProConcept documents

- Pro SDK Group on GeoNet

- Tech session video recordings

- Blog posts

Page 24: ArcGIS Pro SDK for .NET: Introduction to …...•Develop Pro add-ins which allow extending and customizing of Pro • Microsoft Visual Studio 2017 & 2019 –code in C# or VB.NET •

Collaborate and Send Feedback

• ArcGIS Pro SDK Group on GeoNet- Ask technical questions and search on existing questions

- Collaborate with the developer community

• We welcome your input and feedback on the Pro SDK- New requirements and the workflows these would support

- Feedback and suggestions on the SDK documentation, code samples and snippets

Page 25: ArcGIS Pro SDK for .NET: Introduction to …...•Develop Pro add-ins which allow extending and customizing of Pro • Microsoft Visual Studio 2017 & 2019 –code in C# or VB.NET •

Questions?

Page 26: ArcGIS Pro SDK for .NET: Introduction to …...•Develop Pro add-ins which allow extending and customizing of Pro • Microsoft Visual Studio 2017 & 2019 –code in C# or VB.NET •

Print Your Certificate of Attendance

Print Stations Located in 150 Concourse Lobby

Tuesday12:30 pm – 6:30 pmExpoHall B

5:15 pm – 6:30 pmExpo SocialHall B

Wednesday10:45 am – 5:15 pmExpoHall B

6:30 pm – 9:30 pmNetworking ReceptionSmithsonian National Museumof Natural History

Page 27: ArcGIS Pro SDK for .NET: Introduction to …...•Develop Pro add-ins which allow extending and customizing of Pro • Microsoft Visual Studio 2017 & 2019 –code in C# or VB.NET •

Download the EsriEvents app and find

your event

Select the session you attended

Scroll down to “Survey”

Log in to access the survey

Complete the survey and select “Submit”

Please Share Your Feedback in the App

Page 28: ArcGIS Pro SDK for .NET: Introduction to …...•Develop Pro add-ins which allow extending and customizing of Pro • Microsoft Visual Studio 2017 & 2019 –code in C# or VB.NET •