ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / MapTool Class / SketchTipID Property
Example

In This Topic
    SketchTipID Property
    In This Topic
    Gets and sets the DAML ID of the embeddable control to show as a sketch tip.The control follows the cursor when the tool is active.
    Syntax
    Protected Property SketchTipID As String
    protected string SketchTipID {get; set;}
    Remarks
    In some cases you may need to provide a control that displays on top of the map view when the tool is active and provides some type of tool tip similar to the constraint tips that appear when sketching. This property allows you to define an Embeddable Control to display on top of the map view and follow the cursor when the tool is active. When you activate a different tool the overlay control will be removed. You can get a reference to the Embeddable Control using the SketchTipEmbeddableControl property.
    Example
    Set a custom UI Sketch Tip
    // 1. Add an embeddable control using VS template.  This is the daml entry
    
    //<categories>
    //  <updateCategory refID = "esri_embeddableControls">
    //    <insertComponent id="SketchTip_EmbeddableControl1" className="EmbeddableControl1ViewModel">
    //      <content className = "EmbeddableControl1View"/>
    //    </insertComponent>
    //  </updateCategory>
    // </categories>
    
    // 2. Define UI controls on the EmbeddableControl1View
    // 3. Define properties on the EmbeddableControl1ViewModel which
    //    bind to the UI controls on the EmbeddableControl1View
    /// <summary>
    /// Represents a map sketch tool that displays a custom UI sketch tip using an embeddable control.
    /// </summary>
    public class SketchToolWithUISketchTip : MapTool
    {
      public SketchToolWithUISketchTip()
      {
        IsSketchTool = true;
        SketchType = SketchGeometryType.Line;
        SketchOutputMode = SketchOutputMode.Map;
        SketchTipID = "SketchTip_EmbeddableControl1";
      }
    
      protected override Task<bool> OnSketchModifiedAsync()
      {
        var sketchTipVM = SketchTipEmbeddableControl as EmbeddableControl1ViewModel;
        if (sketchTipVM != null)
        {
          // modify properties on the sketchTipVM
          QueuedTask.Run(async () =>
          {
            var sketch = await GetCurrentSketchAsync();
            var line = sketch as Polyline;
            var count = line.PointCount;
    
            sketchTipVM.Text = "Vertex Count " + count.ToString();
          });
        }
    
        return base.OnSketchModifiedAsync();
      }
    
    }
    
    /// <summary>
    /// Represents the view model for an embeddable control, providing data and configuration options for the control's
    /// behavior and appearance.
    /// </summary>
    /// <remarks>This class is typically used to supply options and state to an embeddable control within the
    /// ArcGIS Pro framework. It is constructed with configuration data and a flag indicating whether options can be
    /// changed at runtime.</remarks>
    public class EmbeddableControl1ViewModel : ArcGIS.Desktop.Framework.Controls.EmbeddableControl
    {
      public EmbeddableControl1ViewModel(XElement options, bool canChangeOptions) : base(options, canChangeOptions)
      { }
    
      public string Text;
    }
    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also