![](dotnetdiagramimages/image1259.png)
public class PopupContent : ArcGIS.Desktop.Framework.Contracts.PropertyChangedBase, System.ComponentModel.INotifyPropertyChanged
Public Class PopupContent Inherits ArcGIS.Desktop.Framework.Contracts.PropertyChangedBase Implements System.ComponentModel.INotifyPropertyChanged
public void ShowCustomPopup() { //Get the active map view. var mapView = MapView.Active; if (mapView == null) return; //Create custom popup content var popups = new List<PopupContent> { new PopupContent("<b>This text is bold.</b>", "Custom tooltip from HTML string"), new PopupContent(new Uri("http://www.esri.com/"), "Custom tooltip from Uri") }; mapView.ShowCustomPopup(popups); }
public void ShowCustomPopupWithWindowDef() { if (MapView.Active == null) return; //Create custom popup content var popups = new List<PopupContent> { new PopupContent("<b>This text is bold.</b>", "Custom tooltip from HTML string"), new PopupContent(new Uri("http://www.esri.com/"), "Custom tooltip from Uri") }; // Sample code: https://github.com/ArcGIS/arcgis-pro-sdk-community-samples/blob/master/Framework/DynamicMenu/DynamicFeatureSelectionMenu.cs var topLeftCornerPoint = new System.Windows.Point(200, 200); var popupDef = new PopupDefinition() { Append = true, // if true new record is appended to existing (if any) Dockable = true, // if true popup is dockable - if false Append is not applicable Position = topLeftCornerPoint, // Position of top left corner of the popup (in pixels) Size = new System.Windows.Size(200, 400) // size of the popup (in pixels) }; MapView.Active.ShowCustomPopup(popups, null, true, popupDef); }
public void ShowCustomPopup(MapMember mapMember, long objectID) { //Get the active map view. var mapView = MapView.Active; if (mapView == null) return; //Create custom popup content from existing map member and object id var popups = new List<PopupContent>(); popups.Add(new PopupContent(mapMember, objectID)); //Create a new custom command to add to the popup window var commands = new List<PopupCommand>(); commands.Add(new PopupCommand( p => MessageBox.Show(string.Format("Map Member: {0}, ID: {1}", p.MapMember, p.IDString)), p => { return p != null; }, "My custom command", System.Windows.Application.Current.Resources["GenericCheckMark16"] as ImageSource)); mapView.ShowCustomPopup(popups, commands, true); }
System.Object
ArcGIS.Desktop.Framework.Contracts.PropertyChangedBase
ArcGIS.Desktop.Mapping.PopupContent
Target Platforms: Windows 11, Windows 10