Visual Basic (Declaration) | |
---|---|
Public ReadOnly Property Description As String |
C# | |
---|---|
public string Description {get;} |
When authoring an ArcGISTiledMapServiceLayer in ArcMap to publish an ArcGIS Server web service, the Description information is set in the Description section on the General tab of the Data Frame Properties dialog. See the following ArcMap screen shot:
How to use:
When the ArcGISTiledMapServiceLayer Initializes the Description will be automatically populated in the TextBlock.The XAML code in this example is used in conjunction with the code-behind (C# or VB.NET) to demonstrate the functionality.
The following screen shot corresponds to the code example in this page.
XAML | Copy Code |
---|---|
<Grid x:Name="LayoutRoot"> <!-- Add a Map Control. --> <esri:Map Background="White" HorizontalAlignment="Left" Margin="0,180,0,0" Name="Map1" VerticalAlignment="Top" Height="300" Width="400" Extent="-83.32,42.58,-83.29,42.61" > <!-- Define an ArcGISTiledMapServiceLayer. --> <esri:ArcGISTiledMapServiceLayer Url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/TaxParcel/AssessorsBasemap/MapServer" Initialized="ArcGISTiledMapServiceLayer_Initialized"/> </esri:Map> <!-- Description (Read Only). --> <sdk:Label Height="24" HorizontalAlignment="Left" Margin="0,88,0,0" Name="Label_Description" VerticalAlignment="Top" Width="120" Content="Description:"/> <TextBox Height="69" HorizontalAlignment="Left" Margin="0,105,0,0" Name="TextBox_Description" VerticalAlignment="Top" Width="400" TextWrapping="Wrap" /> <!-- As an alternative you could bind the ArcGISTiledMapServiceLayer.Description directly to the TextBox.Text Property and not need to put any code in the code-behind for the ArcGISTiledMapServiceLayer.Initialized Event. --> <!--<TextBox Height="69" HorizontalAlignment="Left" Margin="0,105,0,0" Name="TextBox_Description" TextWrapping="Wrap" VerticalAlignment="Top" Width="400" Text="{Binding ElementName=Map1, Path=Layers[0].Descripton}"/>--> <!-- Provide the instructions on how to use the sample code. --> <TextBlock Height="52" HorizontalAlignment="Left" Name="TextBlock1" VerticalAlignment="Top" Width="400" TextWrapping="Wrap" Text="When the ArcGISTiledMapServiceLayer Initializes the Description will be automatically populated in the TextBlock." /> </Grid> |
C# | Copy Code |
---|---|
private void ArcGISTiledMapServiceLayer_Initialized(object sender, System.EventArgs e) { // Get the first layer in the Map. ESRI.ArcGIS.Client.ArcGISTiledMapServiceLayer myArcGISTiledMapServiceLayer = null; myArcGISTiledMapServiceLayer = (ESRI.ArcGIS.Client.ArcGISTiledMapServiceLayer)(Map1.Layers[0]); // Description (Read Only). // NOTE: The Description information is set in the Description section on the General tab of the Data Frame // Properties dialog in ArcMap. TextBox_Description.Text = myArcGISTiledMapServiceLayer.Description; } |
VB.NET | Copy Code |
---|---|
Private Sub ArcGISTiledMapServiceLayer_Initialized(ByVal sender As System.Object, ByVal e As System.EventArgs) ' Get the first layer in the Map. Dim myArcGISTiledMapServiceLayer As ESRI.ArcGIS.Client.ArcGISTiledMapServiceLayer myArcGISTiledMapServiceLayer = CType(Map1.Layers.Item(0), ESRI.ArcGIS.Client.ArcGISTiledMapServiceLayer) ' Description (Read Only). ' NOTE: The Description information is set in the Description section on the General tab of the Data Frame ' Properties dialog in ArcMap. TextBox_Description.Text = myArcGISTiledMapServiceLayer.Description End Sub |
Target Platforms: Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family, Windows 7