Select to view content in your preferred language

How to show costum images in ArcGIS Pro notification?

1617
3
Jump to solution
11-11-2018 01:46 AM
KarstenRank
Frequent Contributor

I wrote an ArcGIS Pro addin with the SDK to show notifications.

Since Version 2.2 showing costum images in notifications should be possible. How can I reach them, if they are put to the image folder an should be shown in the internal class Module1.

notification = new NotificationItem(dateNews, false, thema, NotificationType.Custom, date: myDate,
 customImage: "pack://application:,,,/Module1;component/Images/globe30.png");
 NotificationManager.AddNotification(notification);

This toastimage is shown with this code:

notification = new NotificationItem(dateNews, false, thema, NotificationType.Custom, date: myDate,
 customImage: "pack://application:,,,/ArcGIS.Desktop.Resources;component/Images/ToastLicensing16.png");
 NotificationManager.AddNotification(notification);

Thanks Karsten

0 Kudos
1 Solution

Accepted Solutions
UmaHarano
Esri Regular Contributor

Hi Karsten

Is your assembly name "ProAppNews"? If so the the image url should be: 

"pack://application:,,,/ProAppNews;component/Images/globe30.png"

If you right click your project node and select the Properties context menu choice, you can see the assembly name.

Thanks

Uma

View solution in original post

3 Replies
UmaHarano
Esri Regular Contributor

Hi Karsten

Is your assembly name "ProAppNews"? If so the the image url should be: 

"pack://application:,,,/ProAppNews;component/Images/globe30.png"

If you right click your project node and select the Properties context menu choice, you can see the assembly name.

Thanks

Uma

KarstenRank
Frequent Contributor

Thank you Uma!

It works again fine!

0 Kudos
StefanDieters1
Occasional Contributor

The image must be a Resource rather than Add-In Content within your Visual Studio.

Set this under the image's properties.

0 Kudos