ArcGIS API for WPF - Library Reference
MapName Property
See Also  Example Send comments on this topic
ESRI.ArcGIS.Client Namespace > ArcGISDynamicMapServiceLayer Class : MapName Property

Gets the name of the ArcGISDynamicMapServiceLayer hosted by a map service.

Syntax

Visual Basic (Declaration) 
Public ReadOnly Property MapName As String
C# 
public string MapName {get;}

Example

XAMLCopy Code
<StackPanel Name="StackPanel1" Height="400" Width="400" Margin="0,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" >
    <esri:Map Background="White" Name="Map1" Height="200" Width="400">
    
         <!-- Define an ArcGISDynamicMapServiceLayer. -->
         <esri:ArcGISDynamicMapServiceLayer 
              Url="http://sampleserver1.arcgisonline.com:80/arcgis/rest/services/Specialty/ESRI_StateCityHighway_USA/MapServer" />
              
    </esri:Map>
    
    <!-- MapName (Read Only). -->
    <TextBlock Height="22" Name="TextBlock_MapName" Text="{Binding ElementName=Map1, Path=Layers[0].MapName}" />
</StackPanel>
C#Copy Code
private void ArcGISDynamicMapServiceLayer_Initialized(object sender, System.EventArgs e)
{
  // The myArcGISDynamicMapServiceLayer (an ArcGISDynamicServiceLayer object) and TextBlock_MapName
  // (a TextBlock object) were defined previously in the XAML or code-behind.
                
  // Get the first layer in the LayerInfo collection. 
  ArcGISDynamicMapServiceLayer myArcGISDynamicMapServiceLayer = (ArcGISDynamicMapServiceLayer)Map1.Layers[0];
    
  // MapName Property (Read Only)
  TextBlock_MapName.Text = myArcGISDynamicMapServiceLayer.MapName;
}
VB.NETCopy Code
Private Sub ArcGISDynamicMapServiceLayer_Initialized(ByVal sender As System.Object, ByVal e As System.EventArgs)
                
  ' The myArcGISDynamicMapServiceLayer (an ArcGISDynamicServiceLayer object) and TextBlock_MapName
  ' (a TextBlock object) were defined previously in the XAML or code-behind.
                
  ' Get the first layer in the LayerInfo collection. 
  Dim myArcGISDynamicMapServiceLayer As ESRI.ArcGIS.Client.ArcGISDynamicMapServiceLayer = Map1.Layers.Item(0)
                
  ' MapName Property (Read Only)
  TextBlock_MapName.Text = myArcGISDynamicMapServiceLayer.MapName
                
End Sub

Remarks

ArcGIS Server REST map services only support the default data frame (map).

Requirements

Target Platforms: Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© ESRI, Inc. All Rights Reserved.