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

The initial extent reported by the ArcGISDynamicServiceLayer.

Syntax

Visual Basic (Declaration) 
Public ReadOnly Property InitialExtent As Envelope
C# 
public Envelope InitialExtent {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>
    
    <!-- InitialExtent Property (Read Only) -->
    <TextBlock Height="23" HorizontalAlignment="Left" Margin="128,97,0,0" Name="TextBlock_InitialExtent_XMax" 
               Text="{Binding ElementName=Map1, Path=Layers[0].InitialExtent.XMax, StringFormat=\{0:F3\}}" 
               VerticalAlignment="Top" Width="58" />
    <TextBlock Height="23" HorizontalAlignment="Left" Margin="192,97,0,0" Name="TextBlock_InitialExtent_XMin" 
               Text="{Binding ElementName=Map1, Path=Layers[0].InitialExtent.XMin, StringFormat=\{0:F3\}}" 
               VerticalAlignment="Top" Width="58" />
    <TextBlock Height="23" HorizontalAlignment="Left" Margin="256,97,0,0" Name="TextBlock_InitialExtent_YMax" 
               Text="{Binding ElementName=Map1, Path=Layers[0].InitialExtent.YMax, StringFormat=\{0:F3\}}" 
               VerticalAlignment="Top" Width="58" />
    <TextBlock Height="23" HorizontalAlignment="Left" Margin="320,97,0,0" Name="TextBlock_InitialExtent_YMin" 
               Text="{Binding ElementName=Map1, Path=Layers[0].InitialExtent.YMin, StringFormat=\{0:F3\}}" 
               VerticalAlignment="Top" Width="58" />
</StackPanel>
C#Copy Code
private void ArcGISDynamicMapServiceLayer_Initialized(object sender, System.EventArgs e)
{
    // The myArcGISDynamicMapServiceLayer (an ArcGISDynamicServiceLayer object), TextBlock_InitialExtent_XMax
    // (a TextBlock object),  TextBlock_InitialExtent_XMin (a TextBlock object), TextBlock_InitialExtent_YMax
    // (a TextBlock object), and TextBlock_InitialExtent_YMin (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];
    
    // InitialExtent (Read Only).
    ESRI.ArcGIS.Client.Geometry.Envelope myEnvelope = myArcGISDynamicMapServiceLayer.InitialExtent;
    TextBlock_InitialExtent_XMax.Text = myEnvelope.XMax.ToString();
    TextBlock_InitialExtent_XMin.Text = myEnvelope.XMin.ToString();
    TextBlock_InitialExtent_YMax.Text = myEnvelope.YMax.ToString();
    TextBlock_InitialExtent_YMin.Text = myEnvelope.YMin.ToString();
}
VB.NETCopy Code
Private Sub ArcGISDynamicMapServiceLayer_Initialized(ByVal sender As System.Object, ByVal e As System.EventArgs)
    ' The myArcGISDynamicMapServiceLayer (an ArcGISDynamicServiceLayer object), TextBlock_InitialExtent_XMax
    ' (a TextBlock object),  TextBlock_InitialExtent_XMin (a TextBlock object), TextBlock_InitialExtent_YMax
    ' (a TextBlock object), and TextBlock_InitialExtent_YMin (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)
    
    ' InitialExtent (Read Only).
    Dim myEnvelope As ESRI.ArcGIS.Client.Geometry.Envelope = myArcGISDynamicMapServiceLayer.InitialExtent
    TextBlock_InitialExtent_XMax.Text = myEnvelope.XMax.ToString
    TextBlock_InitialExtent_XMin.Text = myEnvelope.XMin.ToString
    TextBlock_InitialExtent_YMax.Text = myEnvelope.YMax.ToString
    TextBlock_InitialExtent_YMin.Text = myEnvelope.YMin.ToString
End Sub

Requirements

Target Platforms:Windows Phone 7

See Also

© ESRI, Inc. All Rights Reserved.