private void LoadFeatureData() { FeatureLayer _featureLayer = MyMap.Layers["MyFeatureLayer"] as FeatureLayer; Graphic _graphicSource = _featureLayer.Graphics[0]; ESRI.ArcGIS.Client.FeatureService.FeatureLayerInfo _layerInfo = _featureLayer.LayerInfo; FeatureType _ftype = null; if ( false == string.IsNullOrEmpty(_featureLayer.LayerInfo.TypeIdField) ) { _ftype = _featureLayer.LayerInfo.FeatureTypes[_graphicSource.Attributes[_featureLayer.LayerInfo.TypeIdField]]; } foreach (Field fld in _featureLayer.LayerInfo.Fields) { //ObjectID Field if (fld.Name == _layerInfo.ObjectIdField) { TextBlock fieldoid = new TextBlock(); fieldoid.Text = fld.Alias; EditForm.Children.Add(fieldoid); TextBlock oid = new TextBlock(); oid.Text = _graphicSource.Attributes[_layerInfo.ObjectIdField] != null ? _graphicSource.Attributes[_layerInfo.ObjectIdField].ToString() : ""; EditForm.Children.Add(oid); } else { TextBlock field = new TextBlock(); field.Text = fld.Alias; field.Foreground = forgroundBrush; field.FontWeight = FontWeights.Bold; EditForm.Children.Add(field); //Type Field if (fld.Name == _featureLayer.LayerInfo.TypeIdField)//This is the type field {
Los miembros registrados pueden publicar, seguir actualizaciones y más. ¿Nuevo aquí? Regístrate gratis.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.