FeatureLayer l; private void FeatureLayer_MouseLeftButtonDown(object sender, GraphicMouseButtonEventArgs e) { l = sender as FeatureLayer; e.Graphic.AttributeValueChanged += Graphic_AttributeValueChanged; var oldVal = (int)e.Graphic.Attributes[l.LayerInfo.TypeIdField]; e.Graphic.Attributes[l.LayerInfo.TypeIdField] = oldVal == 0 ? 1 : 0; var affectedGraphicId = (int)e.Graphic.Attributes[l.LayerInfo.ObjectIdField]; } void Graphic_AttributeValueChanged(object sender, ESRI.ArcGIS.Client.Graphics.DictionaryChangedEventArgs e) { Graphic g = sender as Graphic; g.AttributeValueChanged -= Graphic_AttributeValueChanged; if (e.Key == "type") { g.Attributes["description"] = string.Format("Type was changed on {0} from {1} to {2}:", DateTime.UtcNow, e.OldValue, e.NewValue); l.SaveEdits(); } }
サインインしたメンバーは投稿、更新のフォローなどができます。初めてですか?無料アカウントを登録してください。
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.