Editor Widget

This sample demonstrates using the ArcGIS Runtime SDK for WPF to add, edit, move, delete, and save local features in two ArcGISLocalFeatureLayer using the ESRI.ArcGIS.Client.Toolkit EditorWidget.

The two editable local feature layers represent points of interest and fire evacuation areas. Use the symbol templates to add new local features. Use the tools to modify or delete existing features. Save your edits when finished to commit any updates to the database.

Download Sample Application
XAML C# VB.NET
<UserControl x:Class="ArcGISWPFSDK.LocalEditorWidget"
           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/client/2009">
    <Grid x:Name="LayoutRoot" Background="White">
        <Grid.Resources>
            <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
            <LinearGradientBrush x:Key="PanelGradient" EndPoint="0.5,1" StartPoint="0.5,0">
                <LinearGradientBrush.RelativeTransform>
                    <TransformGroup>
                        <ScaleTransform CenterY="0.5" CenterX="0.5"/>
                        <SkewTransform CenterY="0.5" CenterX="0.5"/>
                        <RotateTransform Angle="176" CenterY="0.5" CenterX="0.5"/>
                        <TranslateTransform/>
                    </TransformGroup>
                </LinearGradientBrush.RelativeTransform>
                <GradientStop Color="#FF145787" Offset="0.16"/>
                <GradientStop Color="#FF3D7FAC" Offset="0.502"/>
                <GradientStop Color="#FF88C5EF" Offset="0.984"/>
            </LinearGradientBrush>
        </Grid.Resources>
        <esri:Map x:Name="MyMap" WrapAround="True" Extent="-15000000,2000000,-7000000,8000000" Background="#FFE3E3E3" MinimumResolution="2445.98490512499">
            <esri:ArcGISLocalTiledLayer ID="BaseMap" Path="..\\Data\\TPKs\\Topographic.tpk"/>
            <esri:ArcGISLocalFeatureLayer ID="PointsofInterest" Path="..\\Data\\MPKS\\PointsofInterest.mpk" LayerName="PointsofInterest" AutoSave="False" Editable="True" OutFields="*"></esri:ArcGISLocalFeatureLayer>
            <esri:ArcGISLocalFeatureLayer ID="Evacuation" Path="..\\Data\\MPKS\\PointsofInterest.mpk" LayerName="Evacuation" AutoSave="False" Editable="True" OutFields="*"></esri:ArcGISLocalFeatureLayer>
        </esri:Map>

        <Grid HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,15,15,0" Width="350" >
            <Rectangle Fill="{StaticResource PanelGradient}" Stroke="Gray"  RadiusX="10" RadiusY="10" Margin="0,0,0,5">
                <Rectangle.Effect>
                    <DropShadowEffect/>
                </Rectangle.Effect>
            </Rectangle>
            <Rectangle Fill="#FFFFFFFF" Stroke="DarkGray" RadiusX="5" RadiusY="5" Margin="10,10,10,15" />
            <TextBlock x:Name="InformationText" Foreground="Black" Text="Editable feature layers represent points of interest and evacuation areas.  Use the symbol templates to add new features.  Use the tools to modify or delete existing features. Save your edits when finished to commit any updates to the database." 
                HorizontalAlignment="Center" VerticalAlignment="Top" TextAlignment="Left" Margin="30,20,20,30" TextWrapping="Wrap" />
        </Grid>

        <StackPanel  x:Name="EditorToolStrip" Margin="0,5,5,0" >
            <Border Background="{StaticResource PanelGradient}" CornerRadius="5"
                        HorizontalAlignment="Right"  VerticalAlignment="Top"
                        Padding="5" BorderBrush="Transparent">
                <Border.Effect>
                    <DropShadowEffect Color="Black" Direction="-45" BlurRadius="20" Opacity=".75" />
                </Border.Effect>
                <StackPanel Orientation="Vertical" HorizontalAlignment="Right" Margin="0,5,5,0"    VerticalAlignment="Top" >
                    <esri:EditorWidget x:Name="MyEditorWidget"
                             Map="{Binding ElementName=MyMap}" 
                                      Width="300" 
                                      AutoSelect="False"                                     
                                      ShowAttributesOnAdd="True"  
                                      Loaded="EditorWidget_Loaded"/>
                </StackPanel>
            </Border>
        </StackPanel>
        <ProgressBar x:Name="MyProgressBar" IsIndeterminate="True" VerticalAlignment="Bottom" Width="200" Height="20" Margin="10" Visibility="{Binding Path=IsBusy, Converter={StaticResource BooleanToVisibilityConverter}}"></ProgressBar>
    </Grid>
</UserControl>
  
Sample code usage restrictions
5/16/2014