Esri’s new Utility Network structure is bringing some big changes to the ways we think about GIS. This includes tons of new features and tools in ArcGIS Pro that let you get a handle on utilities like never before. Not least of these features is the switch to the use of Windows Presentation Foundation (WPF) to customize all sorts of menus and settings in Pro. WPF offers huge extensibility and workability gains over its predecessor, Windows Forms, and Esri provides an entire framework for customizing ArcGIS Pro with WPF. Esri calls this a Configuration. This configuration model lets users customize everything from the toolbar ribbons to the splash screen, allowing you to bring a completely tailored, streamlined, and efficient product to your workflow.
If you caught the SSP Productivity demo at GeoConX, then you’ve already had a taste of what Pro can offer. SSP Productivity offers a streamlined start page and a fully customized SSP ribbon to make common workflows easy and convenient. Over the course of this article series, we’re going to walk through some of the steps required to build your own configuration for ArcGIS Pro, including a splash screen, start page, and basic dockpane.
If that’s all done, then let’s get started!
The first thing to do is to create a new configuration project. Open up Visual Studio, click “New Project…”, and search for “ArcGIS Pro Managed configuration.” This can also be found under
Installed → Templates → Visual C# → ArcGIS → ArcGIS Pro Add-ins.
Give the project an appropriate name and location, and click OK. Visual Studio will bring you into your new project. This template already includes complete basic functionality, so let’s take a quick tour of the project. There are several files to be mindful of, and understanding each of their functions is crucial to building the app.
This is likely the file Visual Studio popped in front of you when you loaded the project. This config file defines the tools and controls that we’ll be adding to ArcGIS Pro. Note the <ConfigurationManager …> tags. These define the class that in turn defines the custom UI. Removing this definition will run Pro without any custom startup, but will still load the tools defined in <module>. The <module …> tag defines the toolset that will be built to add to pro. Configurations and Add-ins are treated separately and install using different assemblies, so they have separate definitions in the .daml. For now, we can leave this file alone. We’ll come back later to add a tool to our module.
This file is created at the top level of the project hierarchy, and it is the core controller for the configuration. This file contains methods that define the behavior of all the custom UI. In most projects, I recommend changing the file and class names to be more descriptive. If you do so, remember to update the definition in Config.daml to reflect your new name. Note that this class inherits from ConfigurationManager. This class provides all the overrides needed to define our custom UI, and includes methods to intercept module DAML code and rewrite it before ArcGIS Pro loads that module. This is a handy feature that can be used to customize toolsets based on user authentication or environment settings. Let’s walk through some of the members of ConfigurationManager:
Here we see our first example of a WPF design. When you open it, Visual Studio will give you a split view of the design and of the .xaml that drives it. This file in particular has a lot of complex ideas behind it, but on a high-level you’ll notice it follows principles of any high-level markup language, like HTML. We’ll break down parts of this file later, as it has some handy pieces we can re-use for our own Start Page. Note: If you look at the end of the topmost UserControl tag (line 13) you can see that the View itself can set the DataContext to its ViewModel. This is useful if you don’t have a way to instantiate your view in the first place.
This file represents all the data and logic for the StartPage view. The template project has given us a small collection of custom behavior for
This class allows us to programmatically find a reference to the custom module that this project loads. If your tool requires logic when it closes, you can pause the application close using CanUnload() here.
On a high level, that’s all the important items to point out on our tour through this project. We just need to make one last stop.
Right-click on your project in Solution Explorer, and navigate to the Debug options. Under Command line arguments, you’ll see:
This is the flag that tells ArcGIS Pro to load your configuration. You can remove this flag if you ever want to test Pro without the config attached. This also comes in handy if you want to make a shortcut to ArcGIS Pro and include your configuration. Keep in mind, this command will only search the folders you have configured within ArcGIS Pro’s settings. Pro adds the following path by default, and this is where your project will build the assembly to launch the configuration.
That’s most of the hot-points for the tour of Pro’s configuration template. As you might guess, there are a lot of places where you can extend functionality and develop custom UI. In Part 2 we’ll dig much deeper into WPF and build out a custom splash screen to include in our project.