<esri:FeatureLayer ID="MG_Polygon" Visible="True" MouseLeftButtonUp="Poly_MouseLeftButtonUp" Url="http://156.555.555.189/ArcGIS/rest/services/TEST_FS/FeatureServer/24" DisableClientCaching="True" Mode="OnDemand" SelectionColor="#FFFFFF00" OutFields="*" />
Private Sub Poly_MouseLeftButtonUp(ByVal sender As 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() MyPolygonFeatureDataForm.GraphicSource = args.Graphic PolygonDataFormBorder.Visibility = Visibility.Visible End Sub
Solved! Go to Solution.
DataFormBorder.Visibility = Visibility.Visible
FeatureDataForm.GraphicSource = change.Geometry
FeatureDataForm.FeatureLayer = TryCast(change.Layer, FeatureLayer)
FeatureDataForm.GraphicSource = change.Graphic
private void Editor_EditCompleted(object sender, ESRI.ArcGIS.Client.Editor.EditEventArgs e) { if (e.Action == ESRI.ArcGIS.Client.Editor.EditAction.Add) { // e.Edits contains graphics that was added and the layer the graphic was added to } }
Private Sub Editor_EditCompleted(ByVal sender As System.Object, ByVal e As ESRI.ArcGIS.Client.Editor.EditEventArgs) ' 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 Dim editor As Editor = TryCast(LayoutRoot.Resources("MyEditor"), Editor) For Each graphicsLayer As GraphicsLayer In editor.GraphicsLayers If TypeOf graphicsLayer Is FeatureLayer Then Dim featureLayer As FeatureLayer = TryCast(graphicsLayer, FeatureLayer) If featureLayer.HasEdits Then MessageBox.Show("Has Edits") Else MessageBox.Show("No Edits") End If End If Next graphicsLayer End If End Sub
if (e.Action == ESRI.ArcGIS.Client.Editor.EditAction.Add) { foreach (ESRI.ArcGIS.Client.Editor.Change change in e.Edits) { MyFeatureDataForm.GraphicSource = change.Graphic; // this is the newly added graphic } }
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 If Test = "MG_Point" Then ' this is the newly added graphic MyPointFeatureDataForm.GraphicSource = change.Graphic PointDataFormBorder.Visibility = Visibility.Visible LineDataFormBorder.Visibility = Visibility.Collapsed PolygonDataFormBorder.Visibility = Visibility.Collapsed ElseIf Test = "MG_Line" Then ' this is the newly added graphic MyLineFeatureDataForm.GraphicSource = change.Graphic PointDataFormBorder.Visibility = Visibility.Collapsed LineDataFormBorder.Visibility = Visibility.Visible PolygonDataFormBorder.Visibility = Visibility.Collapsed ElseIf Test = "MG_Polygon" Then ' this is the newly added graphic MyPolygonFeatureDataForm.GraphicSource = change.Graphic PointDataFormBorder.Visibility = Visibility.Collapsed LineDataFormBorder.Visibility = Visibility.Collapsed PolygonDataFormBorder.Visibility = Visibility.Visible Else End If Next End If End Sub
myFeatureDataForm.GraphicSource = change.Geometry myFeatureDataForm.FeatureLayer = change.Layer as FeatureLayer;