Select to view content in your preferred language

Extending ArcGIS Pro with the Pro SDK (5): Customizing the configuration management screen

2480
0
10-28-2018 09:49 PM
Labels (1)
Extending ArcGIS Pro with the Pro SDK (5): Customizing the configuration management screen

At first

This article is the fourth in the Extend ArcGIS Pro with the Pro SDK series.
This series shows you how to extend ArcGIS Pro using the ArcGIS Pro SDK (Pro SDK).
Up until the last article, we've covered the process of creating an extension add-in for ArcGIS Pro, which is the goal of this series. In this fifth and final installment, we will show you how to customize the configuration management screen. The configuration management screen is the screen you see until you start ArcGIS Pro and select a project.

Part 1: What is the ArcGIS Pro SDK?

Part 2: Environment construction

Part 3: Configuring the add-in project

Part 4: Developing add-ins

Part 5: Customizing the management configuration screen (this article)

Development and development steps of the configuration management screen

There are two types of configuration management screens: splash screens and project selection screens.

On the New Project screen in Visual Studio, select ArcGIS Pro Configuration Management, and you'll have a basic project just as you did when you created the add-in.
Even if you don't implement anything, running the project in Visual Studio will launch ArcGIS Pro and display a customized configuration management screen by default.

In this article, I'll customize the two screens that are customizable in the Pro SDK as follows: Finally, you'll learn how to apply your customized screens to ArcGIS Pro installations on other machines.

  1. Splash Screen Screen: Changing the Title String and Image
  2. Project selection screen: Count the number of existing projects and display them on the screen
  3. (Application): Apply the configuration management screen

Tips: Benefits and cases of customizing the configuration management screen

You can make the experience up to the selection of a project more useful. For example, you can make it easier for users to see a large number of projects, or to configure a screen that allows users to select only a specific project. In this case, you can use it to sell it as your company's own branded app that includes ArcGIS Pro.

Implementation Explanation

When the ArcGIS Pro Configuration Management project is created, you have a file structure similar to the following:

Each file to update is the following file:

  • Splash screen screen
    • SplashScreen.xaml
  • Project Selection Screen
    • StartPage.xaml
    • StartPageViewModel.cs (Count the number of projects)

Splash screen screen

To change the display screen using any image, follow the steps below.

  1. Register the images you want to use with Visual Studio
  2. Modify the code

1. Register the image you want to use with Visual Studio

In Visual Studio, you can't just store any images you want to use in a folder in your project to reflect them in your development environment.
Select the Image folder in Solution Explorer to load the specified image from an existing item.
In addition, for imported images, make the following settings from [Properties].

Build Action: Resource
Copy to Output Directory: Do not copy

2. Change the code

The splash screen display is defined in the SplashScreen.xaml file, and is implemented in the following code:
We've modified the existing code to implement image specification and string changes.

< existing code>

<Grid>
 <Border BorderBrush="Black" BorderThickness="3" Margin="10">
 <TextBlockStyle="{DynamicResource Esri_TextBlockDialogHeader}"
 FontSize="50"
 HorizontalAlignment="Center"
 VerticalAlignment="Center">
 ProConfiguration1
 </TextBlock>
 </Border>
 </Grid>‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍


< code after implementation>

<Grid>
 <Image Source="../Images/myarcgispro.png" HorizontalAlignment="Center" ></Image>
 <TextBlock FontStyle="Normal"
 FontSize="60"
 Foreground="White"
 HorizontalAlignment="Right"
 VerticalAlignment="Bottom"
 Margin="10">
 My ArcGIS Pro
 </TextBlock>
 </Grid>‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

An Image tag is added to set the specified image, and the TextBlock tag is used to define the text and change the font size and color.
By removing the Border tag, you can display a full-screen image.

When you run the project, you can view the specified image.

* This time, I used an image published by NASA .

Project Selection Screen

In order to count the number of existing projects and display them on the screen, follow the steps below.

  1. Define the item to bind (return) the calculation result (StartPage.xaml)
  2. Count the number of projects (StartPageViewModel.cs)

1. Define the item to bind (return) the calculation result (StartPage.xaml)

The "Select a Project to start ArcGIS Pro" displayed on the screen is hard-coded as a string. I'm going to change this.

< existing code>

<TextBlock Grid.Row="0" Text="Select a Project to start ArcGIS Pro" Style="{DynamicResource Esri_TextBlockH1}" VerticalAlignment="Center" Margin="10"></TextBlock>


< implemented code>

<TextBlock Grid.Row="0" Text="{Binding ProProjectCount, StringFormat=選択可能なプロジェクト: {0} }" Style="{DynamicResource Esri_TextBlockH1}" VerticalAlignment="Center" Margin="10"></TextBlock>‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍


Implements attribute values for "Text".
"ProProjectCount" is the name of the next property to implement. "StringFormat" contains a fixed phrase, and "{}" contains the return value of the property specified by Binding.
* Zero in {0} is not the default value.

2. Count the number of projects (StartPageViewModel.cs)

StartPageViewModel.cs Implement the following additionally in the file:
Defines a property that includes a process for counting the number of projects.

// プロジェクト数のカウント プロパティ
public int ProProjectCount
{
 get
 {
 // プロジェクト数をカウントする
 var fileInfos = Project.GetRecentProjects().Select(f => new FileInfo(f));
 var projectCollection = new Collection<FileInfo>(fileInfos.ToList());
 return projectCollection.Count;
 }
}‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍


Process the contents of "ProProjectCount" defined on the screen (StartPage.xaml).
On the Pro SDK side, you can get a list of created project files, so you can use this to count the number of projects and return them to the screen.
* To change the image, a different image is registered and specified in the same way as the procedure for implementing the splash screen screen.

The entire code is available on Esri Japan GitHub Take a look at:

Apply the (Advanced) management configuration screen

The procedure for applying the created management configuration screen is as follows.

  1. Create a .proConfigX file
  2. Install the configuration
  3. Create a shortcut in ArcGIS Pro that applies the file you created in step 1

1.*.proConfigX Create a file

The proConfigX file is created when you build your project for the first time in Visual Studio . When you build the project, the output is to the folder that is set in the build properties.

例: ProConfiguration1.proConfigX

2. Install the configuration

Double-click the *.proConfigX file to install it from the installation screen.

Create a shortcut in ArcGIS Pro that applies the file you created in step 1

Create a new shortcut to the ArcGIS Pro executable (the default location is C:\Program Files\ArcGIS\Pro\bin\ArcGISPro.exe) and click the(I) to set the arguments:

/config:< *.proConfigX ファイル名>

例:/config:ProConfiguration1

Once applied, you can run ArcGIS Pro from the shortcut to see the configuration management screen you created.
* If you start ArcGIS Pro from a shortcut other than this shortcut, it will be a normal startup screen.

Conclusion

This is the final blog in the Extend ArcGIS Pro with the Pro SDK series.
Updates will continue to add more functionality to the ArcGIS Pro SDK . We'll be sharing more on the GeoNet blog as it happens, so stay tuned!

Related Links

Labels (1)

Esri may utilize third parties to translate your data and/or imagery to facilitate communication across different languages.

Version history
Last update:
‎08-21-2024 10:49 PM
Updated by:
Contributors