comboBox.Items.Add(name);
private async void Button_Click(object sender, RoutedEventArgs e) { await QueuedTask.Run(() => { var mapView = MapView.Active; var featureNames = new List<string>(); var featureLayers = mapView.Map.GetLayersAsFlattenedList() .OfType<BasicFeatureLayer>().ToList(); var featureLayersWithSel = featureLayers .Where(fl => fl.GetSelection().GetCount() > 0).ToList(); foreach (var featureLayerWithSel in featureLayersWithSel) { var featureName = featureLayerWithSel.Name; featureNames.Add(featureName); } foreach (var name in featureNames) { comboBox.Items.Add(name); } }); }
Application.Current.Dispatcher.Invoke(() => { comboBox.Items.Add(name); });
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)