public void DisplayFeatures(SharpMap.Geometries.Point point, List <FeatureDataRowLayerPair> rows) { lblPosition.Content = String.Format("Info at: {0} - {1}", GeoUtils.DecDegToDMS(point.X, CoordinateType.Longitude), GeoUtils.DecDegToDMS(point.Y, CoordinateType.Latitude)); _model = new ObservableCollection <FeatureDataElement>(); foreach (FeatureDataRowLayerPair info in rows) { foreach (DataColumn col in info.FeatureDataRow.Table.Columns) { var item = new FeatureDataElement { Name = col.ColumnName, Value = info.FeatureDataRow[col.ColumnName].ToString(), LayerName = info.Layer.LayerName }; _model.Add(item); } } lvw.ItemsSource = _model; CollectionView myView = (CollectionView)CollectionViewSource.GetDefaultView(lvw.ItemsSource); myView.GroupDescriptions.Add(new PropertyGroupDescription("LayerName")); }
public void DisplayFeatures(SharpMap.Geometries.Point point, List<FeatureDataRowLayerPair> rows) { lblPosition.Content = String.Format("Info at: {0} - {1}", GeoUtils.DecDegToDMS(point.X, CoordinateType.Longitude), GeoUtils.DecDegToDMS(point.Y, CoordinateType.Latitude)); _model = new ObservableCollection<FeatureDataElement>(); foreach (FeatureDataRowLayerPair info in rows) { foreach (DataColumn col in info.FeatureDataRow.Table.Columns) { var item = new FeatureDataElement { Name = col.ColumnName, Value = info.FeatureDataRow[col.ColumnName].ToString(), LayerName = info.Layer.LayerName }; _model.Add(item); } } lvw.ItemsSource = _model; CollectionView myView = (CollectionView)CollectionViewSource.GetDefaultView(lvw.ItemsSource); myView.GroupDescriptions.Add(new PropertyGroupDescription("LayerName")); }