Visual Basic (Declaration) | |
---|---|
Public ReadOnly Property ServiceDescription As String |
C# | |
---|---|
public string ServiceDescription {get;} |
XAML | Copy 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> <!-- ServiceDescription Property (Read Only). --> <TextBlock Height="22" Name="TextBlock_ServiceDescription" Text="{Binding ElementName=Map1, Path=Layers[0].ServiceDescription}" /> </StackPanel> |
C# | Copy Code |
---|---|
private void ArcGISDynamicMapServiceLayer_Initialized(object sender, System.EventArgs e) { // The myArcGISDynamicMapServiceLayer (an ArcGISDynamicServiceLayer object) and TextBlock_ServiceDescription // (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]; // ServiceDescription Property (Read Only). TextBlock_ServiceDescription.Text = myArcGISDynamicMapServiceLayer.ServiceDescription; } |
VB.NET | Copy Code |
---|---|
Private Sub ArcGISDynamicMapServiceLayer_Initialized(ByVal sender As System.Object, ByVal e As System.EventArgs) ' The myArcGISDynamicMapServiceLayer (an ArcGISDynamicServiceLayer object) and TextBlock_ServiceDescription ' (a TextBlock object) were defined previously in the XAML or code-behind. ' Get the first layer in the LayerInfo collection. Dim myArcGISDynamicMapServiceLayer As ArcGISDynamicMapServiceLayer = Map1.Layers.Item(0) ' ServiceDescription Property (Read Only). TextBlock_ServiceDescription.Text = myArcGISDynamicMapServiceLayer.ServiceDescription End Sub |
Target Platforms:Windows Phone 7