I want to set the Caption for the map pane to represent what is in that map pane. I know how to do this programmatically to the caption using the following, but that does not save.
ProApp.Panes.ActivePane.Caption = caption;
I know you can do this manually in catalog using Right/Click rename. I want to do this in code based on what I created in that map. This way I don't have to reload the Caption on MapLoad everytime if it is already set.
Solved! Go to Solution.
Hi M,
Your code snippet renames the caption of the pane. If you execute our code snippet you see the pane caption (displayed in the tab) is actually updated. However, a right click 'rename' in Catalog will update the Map object. There is a SetName method to update the name of the map: http://pro.arcgis.com/en/pro-app/sdk/api-reference/#topic11891.html
QueuedTask.Run(() => {
MapView.Active.Map.SetName("Test");
});
map.SetName("name here")? Map name is the default caption.
http://pro.arcgis.com/en/pro-app/sdk/api-reference/#topic11891.html
Hi M,
Your code snippet renames the caption of the pane. If you execute our code snippet you see the pane caption (displayed in the tab) is actually updated. However, a right click 'rename' in Catalog will update the Map object. There is a SetName method to update the name of the map: http://pro.arcgis.com/en/pro-app/sdk/api-reference/#topic11891.html
QueuedTask.Run(() => {
MapView.Active.Map.SetName("Test");
});