bpaneil

How do I access the attributes of the graphic being edited?

Discussion created by bpaneil on Jun 26, 2014
When I try and edit an existing polygon, how do i determine what graphic is being edited, let alone its attributes?

I set up the editor this way:
                this._ESRIMapRowEditor = new Editor();
                this._ESRIMapRowEditor.LayerIDs = new string[] { this.MyShapeAttributes.LayerID };
                _ESRIMapRowEditor.EditCompleted += new EventHandler<Editor.EditEventArgs>(ShapeEditor_EditCompleted);
                _ESRIMapRowEditor.EditorActivated += new EventHandler<Editor.CommandEventArgs>(ShapeEditor_Activate);
                _ESRIMapRowEditor.EditVerticesEnabled = false;
                _ESRIMapRowEditor.RotateEnabled = false;
                _ESRIMapRowEditor.MaintainAspectRatio = true;
                _ESRIMapRowEditor.Map = this.ESRIMap;
                var param = "EditVertices";
                _ESRIMapRowEditor.EditVertices.Execute(param);

Once the activated event is fired, the user then can select a graphic to edit.  In the completed event, i have no access to the attributes of that edited graphic that i know of.

What i can do is get access to the GraphicsLayer collection but I don't have a way to know which one was changed.  The graphic objects within that collection contain an "IsGeometryDirty" flag but this flag doesn't seem to be exposed in the class (see below).
((Graphic)((ESRI.ArcGIS.Client.Editor)sender).GraphicsLayers.ElementAt(0).Graphics[i])
{ESRI.ArcGIS.Client.Graphic}
    base {System.Windows.DependencyObject}: {ESRI.ArcGIS.Client.Graphic}
    _dataContext: {ESRI.ArcGIS.Client.DataBinding}
    _isDrawn: true
    _symbolPropertyChangedWeakEventListener: null
    Attributes: {ESRI.ArcGIS.Client.Graphics.ObservableDictionary}
    AttributeValueChanged: {Method = {Void g_AttributeValueChanged(System.Object, ESRI.ArcGIS.Client.Graphics.DictionaryChangedEventArgs)}}
    DisableMapTip: false
    elementReference: null
    ElementReference: null
    ElementReferenceChanging: {Method = {Void g_ElementReferenceChanging(System.Object, System.EventArgs)}}
    geometry: {ESRI.ArcGIS.Client.Geometry.Polygon}
    Geometry: {ESRI.ArcGIS.Client.Geometry.Polygon}
    GeometryInstanceChanged: {Method = {Void g_GeometryChanged(System.Object, GeometryInstanceChangeEventArgs)}}
    IsGeometryDirty: true
    etc....

Any help would be appreciated.

Thanks.

Outcomes