Create a feature collection layer from a portal item

This samples demonstrates opening a feature collection saved as a portal item.

FeatureCollectionLayer from a portal item

Code

<UserControl x:Class="ArcGISRuntime.WPF.Samples.FeatureCollectionLayerFromPortal.FeatureCollectionLayerFromPortal"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:esri="http://schemas.esri.com/arcgis/runtime/2013">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="300"/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <Grid Grid.Column="0">
            <Grid.RowDefinitions>
                <RowDefinition Height="80"/>
                <RowDefinition Height="60"/>
                <RowDefinition Height="60"/>
                <RowDefinition/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="90"/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <TextBlock Text="Create a feature collection layer:"
                       Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2"
                       VerticalAlignment="Center" HorizontalAlignment="Left"
                       Margin="20,0"/>
            <Button x:Name="OpenPortalFeatureCollectionButton" 
                    Click="OpenPortalFeatureCollectionClick"
                    Content="Open from portal item"
                    VerticalAlignment="Bottom" HorizontalAlignment="Left"
                    Grid.Row="1" Grid.Column="1" 
                    Height="30" Width="150"/>
            <StackPanel Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" 
                        Orientation="Horizontal"
                        Margin="20,3"
                        Height="25">
                <TextBlock Text="Item Id:"
                           VerticalAlignment="Center"/>
                <TextBox x:Name="CollectionItemIdTextBox" 
                         Margin="6,0"
                         VerticalAlignment="Center"
                         Height="20" Width="200"/>
            </StackPanel>
        </Grid>
        <esri:MapView x:Name="MyMapView"
                      Grid.Column="1"/>
    </Grid>
</UserControl>


In this topic
  1. Code