public override void OnInitialize(IEnumerable <ToolOptions> optionsCollection, bool hostIsActiveTemplatePane)
 {
     base.OnInitialize(optionsCollection, hostIsActiveTemplatePane);
     if (MapView.Active == null)
     {
         return;
     }
     //Gather layers in the map
     LayersInMap.Clear();
     foreach (var layer in MapView.Active.Map.GetLayersAsFlattenedList().OfType <FeatureLayer>())
     {
         LayersInMap.Add(layer.Name);
     }
     if (LayersInMap.Count > 0)
     {
         SelectedLayer = LayersInMap[0];
     }
     //Get the table fields
     //Gather fields in the table - to prepopulate
     _ = GetTableFieldsAsync();
 }
Пример #2
0
 bool IEditingCreateToolControl.InitializeForActiveTemplate(ToolOptions options)
 {
     base.InitializeForActiveTemplate(options);
     if (MapView.Active == null)
     {
         return(true);
     }
     //Gather layers in the map
     LayersInMap.Clear();
     foreach (var layer in MapView.Active.Map.GetLayersAsFlattenedList().OfType <FeatureLayer>())
     {
         LayersInMap.Add(layer.Name);
     }
     if (LayersInMap.Count > 0)
     {
         SelectedLayer = LayersInMap[0];
     }
     //Get the table fields
     //Gather fields in the table - to prepopulate
     _ = GetTableFieldsAsync();
     return(true); // true <==> do show me in ActiveTemplate;   false <==> don't show me
 }