ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Editing.Templates Namespace / EditingTemplate Class / ActivateAsync Method
Example

In This Topic
    ActivateAsync Method (EditingTemplate)
    In This Topic
    Activates this EditingTemplate, without changing the current tool.
    Syntax
    Public Function ActivateAsync() As Task
    public Task ActivateAsync()
    Example
    Activate template without changing current tool
    {
      await QueuedTask.Run(() =>
      {
        // Get all templates for the layer
        var templates = featureLayer.GetTemplates();
        if (templates.Count == 0)
          return;
        // Get the first template - alternatively get a specific template
        var template = templates.First();
    
        // Activate the template without changing the current tool
        template.ActivateAsync();
      });
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.6 or higher.
    See Also