<esri:Editor x:Key="MyEditor" Map="{Binding ElementName=MyMap}" LayerIDs="MG_Polygon" GeometryServiceUrl="http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer"
<Border x:Name="DataFormBorder" Visibility="Collapsed" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10,10,10,0" Width="300" Height="300" > <Border.Effect> <DropShadowEffect Color="Black" Direction="-45" BlurRadius="20" Opacity=".75" /> </Border.Effect> <StackPanel Orientation="Vertical"> <esri:FeatureDataForm x:Name="FeatureDataForm" EditEnded="CloseMePoint" FeatureLayer="{Binding Path=Layers[MG_Point], ElementName=MyMap}" IsReadOnly="False" LabelPosition="Left" /> <Button x:Name="CloseButton1" Width="75" Height="20" Content="Close" Margin="0,10,0,0" Click="CloseButton"/> </StackPanel> </Border>
Solved! Go to Solution.
<esri:Editor x:Key="MyEditor" Map="{Binding ElementName=MyMap}" GeometryServiceUrl="http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer"
EditLayer2.Text = "MG_Point" Dim MyEditor = TryCast(Me.LayoutRoot.Resources("MyEditor"), Editor) MyEditor.LayerIDs = New String() {EditLayer2.Text}
<Border x:Name="DataFormBorder" Visibility="Collapsed" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10,10,10,0" Width="300" Height="300" > <Border.Effect> <DropShadowEffect Color="Black" Direction="-45" BlurRadius="20" Opacity=".75" /> </Border.Effect> <StackPanel Orientation="Vertical"> <esri:FeatureDataForm x:Name="FeatureDataForm" EditEnded="CloseMePoint" FeatureLayer="{Binding Path=SET THIS TO EDITOR LAYERIDs, ElementName=MyMap}" IsReadOnly="False" LabelPosition="Left" /> <Button x:Name="CloseButton1" Width="75" Height="20" Content="Close" Margin="0,10,0,0" Click="CloseButton"/> </StackPanel> </Border>
Private Sub Editor_EditCompleted(ByVal sender As System.Object, ByVal e As ESRI.ArcGIS.Client.Editor.EditEventArgs) Dim Test As String = Me.EditLayer2.Text ' e.Edits contains graphics that where added and the layer the graphic was added to If e.Action = ESRI.ArcGIS.Client.Editor.EditAction.Add Then For Each change As ESRI.ArcGIS.Client.Editor.Change In e.Edits FeatureDataForm.FeatureLayer = TryCast(change.Layer, FeatureLayer) FeatureDataForm.GraphicSource = change.Graphic DataFormBorder.Visibility = Visibility.Visible Next End If End Sub
<esri:Editor x:Key="MyEditor" Map="{Binding ElementName=MyMap}" EditCompleted="Editor_EditCompleted" GeometryServiceUrl="http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer" />
Private Sub HandleCheck(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Dim rb As RadioButton = TryCast(sender, RadioButton) EditLayer.Text = "You are now editing: " + ": " + rb.Name Dim _checkedValue As String = rb.Name If _checkedValue = "Point" Then EditLayer2.Text = "MG_Point" Dim MyEditor = TryCast(Me.LayoutRoot.Resources("MyEditor"), Editor) MyEditor.LayerIDs = New String() {EditLayer2.Text} ElseIf _checkedValue = "Line" Then EditLayer2.Text = "MG_Line" Dim MyEditor = TryCast(Me.LayoutRoot.Resources("MyEditor"), Editor) MyEditor.LayerIDs = New String() {EditLayer2.Text} ElseIf _checkedValue = "Polygon" Then EditLayer2.Text = "MG_Polygon" Dim MyEditor = TryCast(Me.LayoutRoot.Resources("MyEditor"), Editor) MyEditor.LayerIDs = New String() {EditLayer2.Text} Else End If End Sub
<Border Background="#FF919191" BorderThickness="1" CornerRadius="5" x:Name="editborder" HorizontalAlignment="Right" VerticalAlignment="Top" Padding="5" BorderBrush="Black" Margin="0,5,5,15" Visibility="Visible"> <StackPanel x:Name="EditorTools" Orientation="Vertical" > <StackPanel Orientation="Horizontal"> <Button Command="{Binding Add}" Margin="2" x:Name="AddButton" DataContext="{StaticResource MyEditor}" ToolTipService.ToolTip="Point" Width="90"Content="Add"> <Button.CommandParameter> <sys:Int32>10101</sys:Int32> </Button.CommandParameter> </Button> </StackPanel> </StackPanel> </Border>
<esri:FeatureLayer ID="MG_Point" Visible="True" MouseLeftButtonUp="Feature_MouseLeftButtonUp" Url="http://189/ArcGIS/rest/services/Maple/MG_FS/FeatureServer/22" DisableClientCaching="True" Mode="OnDemand" SelectionColor="#FFFFFF00" OutFields="*" /> <esri:FeatureLayer ID="MG_Line" Visible="True" MouseLeftButtonUp="Feature_MouseLeftButtonUp" Url="http://189/ArcGIS/rest/services/Maple/MG_FS/FeatureServer/23" DisableClientCaching="True" Mode="OnDemand" SelectionColor="#FFFFFF00" OutFields="*" />
Private Sub Feature_MouseLeftButtonUp(ByVal sender As System.Object, ByVal args As GraphicMouseButtonEventArgs) Dim featureLayer As FeatureLayer = TryCast(sender, FeatureLayer) For Each g As Graphic In featureLayer.Graphics If (g.Selected) Then g.UnSelect() End If Next args.Graphic.Select() FeatureDataForm.GraphicSource = args.Graphic FeatureDataForm.FeatureLayer = featureLayer DataFormBorder.Visibility = Visibility.Visible End Sub
Private Sub Editor_EditCompleted(ByVal sender As System.Object, ByVal e As ESRI.ArcGIS.Client.Editor.EditEventArgs) Dim Test As String = Me.EditLayer2.Text ' e.Edits contains graphics that where added and the layer the graphic was added to If e.Action = ESRI.ArcGIS.Client.Editor.EditAction.Add Then For Each change As ESRI.ArcGIS.Client.Editor.Change In e.Edits 'FeatureDataForm.GraphicSource = change.Geometry FeatureDataForm.FeatureLayer = TryCast(change.Layer, FeatureLayer) FeatureDataForm.GraphicSource = change.Graphic DataFormBorder.Visibility = Visibility.Visible Next End If End Sub