ArcGIS Runtime SDK for WPF - Library Reference
Url Property
See Also  Example
ESRI.ArcGIS.Client Namespace > ArcGISImageServiceLayer Class : Url Property

Gets or sets the URL to an ArcGISImageServiceLayer.

Syntax

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

Remarks

The URL defines the REST endpoint to an ArcGIS Server image service. Use the Services Directory application available with REST services on any ArcGIS Server site to discover the URL.

Property Value

The URL.

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 ArcGISImageServiceLayer. -->
         <esri:ArcGISImageServiceLayer 
              Url="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Portland/CascadeLandsat/ImageServer" />
              
    </esri:Map>
    
    <!-- Url Property (Read/Write) -->
    <TextBlock Height="23" Name="TextBlock_Url" Text="{Binding ElementName=Map1, Path=Layers[0].Url}" />
</StackPanel>
C#Copy Code
private void MainPage_Loaded(object sender, System.Windows.RoutedEventArgs e)
{
     
  // Create an ArcGISImageServiceLayer. The Map1 object (a Map class) was previously defined in XAML.
  ESRI.ArcGIS.Client.ArcGISImageServiceLayer myArcGISImageServiceLayer = new ESRI.ArcGIS.Client.ArcGISImageServiceLayer();
 
     // Set the URL.
  myArcGISImageServiceLayer.Url = "http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Portland/CascadeLandsat/ImageServer";
  
     // Wire-up the event handler.
  myArcGISImageServiceLayer.Initialized += new EventHandler<EventArgs>(ArcGISImageServiceLayer_Initialized);
     
     // Add the ArcGISImageServiceLayer to the Map control.
  Map1.Layers.Add(myArcGISImageServiceLayer);
  
}
             	
private void ArcGISImageServiceLayer_Initialized(object sender, System.EventArgs e)
{
             	
  // The TextBlock_Url (a TextBlock object) was defined previously in the XAML.
            
  //Access a specific layer:
  ESRI.ArcGIS.Client.ArcGISImageServiceLayer myArcGISImageServiceLayer = (ESRI.ArcGIS.Client.ArcGISImageServiceLayer)Map1.Layers[0];
             	
  //Url (Read/Write)
  string myUrl = myArcGISImageServiceLayer.Url;
  if (myUrl != null)
  {
    TextBlock_Url.Text = "Url: " + myUrl;
  }
  else
  {
    TextBlock_Url.Text = "[NO Url SET]";
  }
  
}
VB.NETCopy Code
Private Sub MainPage_Loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles Me.Loaded
             	
  ' Create an ArcGISImageServiceLayer. The Map1 object (a Map class) was previously defined in XAML.
  Dim myArcGISImageServiceLayer As New ESRI.ArcGIS.Client.ArcGISImageServiceLayer
 
     ' Set the URL.
  myArcGISImageServiceLayer.Url = "http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Portland/CascadeLandsat/ImageServer"
  
     ' Wire-up the event handler.
  AddHandler myArcGISImageServiceLayer.Initialized, AddressOf ArcGISImageServiceLayer_Intialized
     
     ' Add the ArcGISImageServiceLayer to the Map control.
  Map1.Layers.Add(myArcGISImageServiceLayer)
  
End Sub
             	
Private Sub ArcGISImageServiceLayer_Initialized(ByVal sender As System.Object, ByVal e As System.EventArgs)
             	
  ' The TextBlock_Url (a TextBlock object) was defined previously in the XAML.
     
  'Access a specific layer:
  Dim myArcGISImageServiceLayer As ESRI.ArcGIS.Client.ArcGISImageServiceLayer = Map1.Layers.Item(0)
             	
  'Url (Read/Write)
  Dim myUrl As String = myArcGISImageServiceLayer.Url
  If myUrl IsNot Nothing Then
    TextBlock_Url.Text = "Url: " + myUrl
  Else
    TextBlock_Url.Text = "[NO Url SET]"
  End If
             	
End Sub

Requirements

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

See Also

© ESRI, Inc. All Rights Reserved.