Cannot create WPF Window in ArcGIS Pro Managed Configuration

1325
4
Jump to solution
01-17-2020 02:00 AM
BarbaraSchneider2
Occasional Contributor II

I have created an ArcGIS Pro Managed Configuration. I now want to add a WPF Window:

1. Right click on project - Add new item

2. Expand Visual C# Items - Select WPF

--> only a User Control (WPF) appears, no Window (WPF), Page (WPF), and so on

Do I have to use an ArcGIS Pro ProWindow instead?

I'm just wondering because a WPF Window is added in the following ProGuide:

ProGuide License Your Add in · Esri/arcgis-pro-sdk Wiki · GitHub 

0 Kudos
1 Solution

Accepted Solutions
Wolf
by Esri Regular Contributor
Esri Regular Contributor

Hi Barbara,

 Gintautas' assessment of your issue is correct.  If you open the configuration project file in a text editor (or edit with Visual Studio) you can insert the following line under the first PropertyGroup tag:

<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>

After you reopen the project in Visual Studio you can now add WPF windows.  In case you are unsure about the edits you can open an Add-in Module project file in a text editor and take a look at the ProjectTypeGuids line there.  Add-in Modules allow you to add WPF windows.  We will update the project templates for the 2.5 release.  Thanks for pointing this out.

- Wolf

View solution in original post

4 Replies
GKmieliauskas
Esri Regular Contributor

Hi Barbara,

I think it is project type problem. I checked on my project and it works as you wrote.

I have copied splashscreen window xaml and code from ArcGIS Pro sample and changed as I needed. Or you can create ArcGIS Pro add-in project, create wpf window in it and then copy files to configuration project.

I have not tried to use ProWindow class in configuration project.

Wolf
by Esri Regular Contributor
Esri Regular Contributor

Hi Barbara,

 Gintautas' assessment of your issue is correct.  If you open the configuration project file in a text editor (or edit with Visual Studio) you can insert the following line under the first PropertyGroup tag:

<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>

After you reopen the project in Visual Studio you can now add WPF windows.  In case you are unsure about the edits you can open an Add-in Module project file in a text editor and take a look at the ProjectTypeGuids line there.  Add-in Modules allow you to add WPF windows.  We will update the project templates for the 2.5 release.  Thanks for pointing this out.

- Wolf

BarbaraSchneider2
Occasional Contributor II

It is also possible to open an ArcGIS Pro ProWindow (Add New Item - ArcGIS - ArcGIS Pro Add-ins).

0 Kudos
Wolf
by Esri Regular Contributor
Esri Regular Contributor

Hi Barbara, ProWindow is the preferred window implementation because Pro styling and required behavior (like coming to the foreground when Pro is active) are implemented in ProWindow.  You can see the difference between ProWindow and WPF window when using the dark theme in this screenshot: