| ArcGIS Explorer Component Help | 
| MapItemCollection..::.AddFirst Method (MapItem) | 
| MapItemCollection Class Example See Also | 
            Adds the specified MapItem to the start of the collection.
            
    Namespace: 
   ESRI.ArcGISExplorer.MappingAssembly: ESRI.ArcGISExplorer (in ESRI.ArcGISExplorer.dll) Version: 2.0.0.1500 (2.0.0.1500)
 Syntax
Syntax
| C# | 
|---|
| public void AddFirst( MapItem item ) | 
| Visual Basic (Declaration) | 
|---|
| Public Sub AddFirst ( _ item As MapItem _ ) | 
Parameters
- item
- Type: ESRI.ArcGISExplorer.Mapping..::.MapItem
 A MapItem object which represents a type of map content.
 Remarks
Remarks
When the AddFirst method is used on MapItemCollection associated with the Map, the added MapItem will appear at the top of the Contents window.
 Examples
Examples
            The code below demonstrates how to add a FeatureLayer to the Map. The AddFirst method ensures that the MapItem
            will appear at the top of the Contents View.
             CopyC#
CopyC# CopyVB.NET
CopyVB.NET
 CopyC#
CopyC#{
  //Get the MapDisplay
  MapDisplay mapDisplay = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay;
  //Create a FeatureLayer for a file geodatabase feature class
  FeatureLayer fLayer = FeatureLayer.OpenFileGeodatabaseTable(@"C:\Data\Yellowstone\yellowstone.gdb", "campsites");
  //Add the FeatureLayer to the start of the MapItemCollection which adds the layer to the Map.
  //It will appear at the top of the contents view.
  mapDisplay.Map.ChildItems.AddFirst(fLayer);
} CopyVB.NET
CopyVB.NET'Get the MapDisplay Dim mapDisp As MapDisplay = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay 'Create a FeatureLayer for a file geodatabase feature class Dim fLayer As FeatureLayer = FeatureLayer.OpenFileGeodatabaseTable("C:\Data\Yellowstone\yellowstone.gdb", "campsites") 'Add the FeatureLayer to the start of the MapItemCollection which adds the layer to the Map. 'It will appear at the top of the contents view. mapDisp.Map.ChildItems.AddFirst(fLayer)




