ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / ElevationProfileGraph Class / ContentLoaded Event
Example

In This Topic
    ContentLoaded Event
    In This Topic
    Occurs when the elevation profile content of the control has been loaded.
    Syntax
    Public Event ContentLoaded As EventHandler
    public event EventHandler ContentLoaded
    Example
    Access the ElevationProfileGraph when added
    {
        // subscribe to the Added, Removed events for the elevation profile graph
        mapView.ElevationProfileGraphAdded += Mv_ElevationProfileGraphAdded;
        mapView.ElevationProfileGraphRemoved += Mv_ElevationProfileGraphRemoved;
        //Handles the event triggered when an elevation profile graph is removed.
        void Mv_ElevationProfileGraphRemoved(object sender, EventArgs e)
        {
            //TODO: handle the removal of the elevation profile graph
        }
        //Handles the event triggered when an elevation profile graph is added to the active map view.
        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;
        }
        // Handles the event triggered when the elevation profile graph content is loaded.
        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 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.5 or higher.
    See Also