ArcGIS Pro 3.5 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / MapView Class / ElevationProfileGraphRemoved Event
Example

In This Topic
    ElevationProfileGraphRemoved Event
    In This Topic
    Occurs when the elevation profile graph is removed.
    Syntax
    public event EventHandler ElevationProfileGraphRemoved
    Public Event ElevationProfileGraphRemoved As EventHandler
    Example
    Access the ElevationProfileGraph when added
    public void ElevationProfileGraphAdded()
    {
    
      var mv = MapView.Active;
      // subscribe to the Added, Removed events for the elevation profile graph
      mv.ElevationProfileGraphAdded += Mv_ElevationProfileGraphAdded;
      mv.ElevationProfileGraphRemoved += Mv_ElevationProfileGraphRemoved;
    
    }
    
    private void Mv_ElevationProfileGraphRemoved(object sender, EventArgs e)
    {
      ;
    }
    
    private void Mv_ElevationProfileGraphAdded(object sender, EventArgs e)
    {
      // get the elevation profile graph from the view
      // this will be non-null since we are in a ElevationProfileGraphAdded handler
      var mv = MapView.Active;
      var graph = mv.GetElevationProfileGraph();
    
      // subscribe to the ContentLoaded event
      graph.ContentLoaded += Graph_ContentLoaded;
    }
    
    private void Graph_ContentLoaded(object sender, EventArgs e)
    {
      // get the elevation profile graph
      var graph = sender as ArcGIS.Desktop.Mapping.ElevationProfileGraph;
    
      // get the elevation profile geometry
      var polyline = graph.Geometry;
      // get the elevation profile statistics
      var stats = graph.ElevationProfileStatistics;
    }
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.5 or higher.
    See Also