I suggest you start following the steps described in this 'Getting Started' video : http://help.arcgis.com/en/webapi/silverlight/help/index.html#//016600000004000000.htm You should end up with a working silverlight application but without editing capabilities. Then you can add editing capabilities by copying and pasting code from the interactive sample. 1) In your MainPage.xaml.cs add this code coming from the sample:private void CancelEditsButton_Click(object sender, RoutedEventArgs e)
{
Editor editor = LayoutRoot.Resources["MyEditor"] as Editor;
foreach (GraphicsLayer graphicsLayer in editor.GraphicsLayers)
{
if (graphicsLayer is FeatureLayer)
{
FeatureLayer featureLayer = graphicsLayer as FeatureLayer;
if (featureLayer.HasEdits)
featureLayer.Update();
}
}
}
2) In your MainPage.xaml add:2.1) The editor resource <Grid.Resources>
<esri:Editor x:Key="MyEditor"
Map="{Binding ElementName=MyMap}"
LayerIDs="ThreatAreas"
GeometryServiceUrl="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer"
/>
</Grid.Resources>
2.2) The FeatureLayer to edit <esri:FeatureLayer ID="ThreatAreas"
Url="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/HomelandSecurity/operations/FeatureServer..."
AutoSave="False"
Mode="OnDemand"
ValidateEdits="True"
DisableClientCaching="True" />
2.3) The whole panel with the editor tools:
<Border Background="#FF919191" BorderThickness="1" CornerRadius="5"
HorizontalAlignment="Right" VerticalAlignment="Top"
Padding="5" BorderBrush="Black" Margin="0,5,5,0"
DataContext="{StaticResource MyEditor}">
<StackPanel x:Name="EditorTools"
Orientation="Vertical">
<StackPanel Orientation="Horizontal">
<Button x:Name="AddButton" Margin="2"
ToolTipService.ToolTip="Fire"
Content="Add Polygon"
Command="{Binding Add}">
<Button.CommandParameter>
<sys:Int32>10301</sys:Int32>
</Button.CommandParameter>
</Button>
<Button x:Name="SelectButton" Margin="2"
Command="{Binding Select}"
CommandParameter="New" >
<TextBlock>New<LineBreak/>Selection</TextBlock>
</Button>
<Button x:Name="AddSelectButton" Margin="2"
Command="{Binding Select}"
CommandParameter="Add">
<TextBlock>Add to<LineBreak/>Selection</TextBlock>
</Button>
<Button x:Name="RemoveSelectButton" Margin="2"
Command="{Binding Select}"
CommandParameter="Remove" >
<TextBlock>Remove from<LineBreak/>Selection</TextBlock>
</Button>
<Button x:Name="ClearSelectionButton" Margin="2"
Command="{Binding ClearSelection}">
<TextBlock>Clear<LineBreak/>Selection</TextBlock>
</Button>
<Button x:Name="DeleteButton" Margin="2"
Command="{Binding DeleteSelected}">
<TextBlock>Delete<LineBreak/>Selected</TextBlock>
</Button>
<Button x:Name="CancelButton" Margin="2"
Command="{Binding CancelActive}">
<TextBlock>Cancel<LineBreak/>Action</TextBlock>
</Button>
</StackPanel>
<StackPanel Orientation="Horizontal">
<Button x:Name="EditVerticesButton" Margin="2"
Command="{Binding EditVertices}">
<TextBlock>Edit Vertices<LineBreak/>/Move Selected</TextBlock>
</Button>
<Button x:Name="CutButton" Margin="2"
Command="{Binding Cut}">
<TextBlock>Cut<LineBreak/>Selected</TextBlock>
</Button>
<Button x:Name="ReshapeButton" Margin="2"
Command="{Binding Reshape}">
<TextBlock>Reshape<LineBreak/>Selected</TextBlock>
</Button>
<Button x:Name="UnionButton" Margin="2"
Command="{Binding Union}">
<TextBlock>Union<LineBreak/>Selected</TextBlock>
</Button>
<Button x:Name="SaveButton" Margin="2"
Command="{Binding Save}">
<TextBlock FontWeight="Bold">Save<LineBreak/>Edits</TextBlock>
</Button>
<Button x:Name="CancelEditsButton" Margin="2"
IsEnabled="{Binding ElementName=MyMap, Path=Layers[ThreatAreas].HasEdits}"
Click="CancelEditsButton_Click" >
<TextBlock FontWeight="Bold">Cancel<LineBreak/>Edits</TextBlock>
</Button>
</StackPanel>
<StackPanel Orientation="Horizontal">
<CheckBox x:Name="FreehandCheckBox" VerticalAlignment="Center" Margin="2"
IsChecked="{Binding Path=Freehand, Mode=TwoWay}"
Content="Freehand Draw" />
<CheckBox x:Name="AutoCompleteCheckBox" VerticalAlignment="Center" Margin="2"
IsChecked="{Binding Path=AutoComplete, Mode=TwoWay}"
Content="Auto Complete" />
<CheckBox x:Name="AutoSelectCheckBox" VerticalAlignment="Center" Margin="2"
IsChecked="{Binding Path=AutoSelect, Mode=TwoWay}"
Content="Auto Select" />
<CheckBox x:Name="ContinuousCheckBox" VerticalAlignment="Center" Margin="2"
IsChecked="{Binding Path=ContinuousMode, Mode=TwoWay}"
Content="Continuous Action" />
</StackPanel>
</StackPanel>
</Border>
You should get an application with editing capabilities.