Select to view content in your preferred language

Change the layer name dynamically

3024
1
Jump to solution
05-04-2012 12:47 PM
by Anonymous User
Not applicable
Original User: rogeryc

Hi,
How can I change the layer name shown in the map contents by code?

Regards.
0 Kudos
1 Solution

Accepted Solutions
by Anonymous User
Not applicable
Original User: rogeryc

I find the solution myself.

I extracted the ESRI.ArcGIS.Mapping.Core dll from the 'MainApplication'.xap, and used the LayerExtensions.SetLayerName static method:

ESRI.ArcGIS.Mapping.Core.LayerExtensions.SetLayerName(layer, "New Name");

Regards.

View solution in original post

0 Kudos
1 Reply
by Anonymous User
Not applicable
Original User: rogeryc

I find the solution myself.

I extracted the ESRI.ArcGIS.Mapping.Core dll from the 'MainApplication'.xap, and used the LayerExtensions.SetLayerName static method:

ESRI.ArcGIS.Mapping.Core.LayerExtensions.SetLayerName(layer, "New Name");

Regards.
0 Kudos