{
if (!MapView.Active.CanShowElevationProfileGraph())
return;
// use a specific elevation surface
var eleLayer = MapView.Active.Map.GetElevationSurfaceLayers().FirstOrDefault(l => l.Name == "TIN");
// set up the parameters
var profileParams = new ElevationProfileParameters();
profileParams.SurfaceLayer = eleLayer;
profileParams.Densify = true;
// show the elevation profile for a polyline using the params
//Any line
Polyline polyline = PolylineBuilderEx.CreatePolyline();
MapView.Active.ShowElevationProfileGraph([polyline], profileParams);
// show the elevation profile for a set of points using the params
//Some points
MapPoint mapPoint = MapPointBuilderEx.CreateMapPoint(34, -118, SpatialReferences.WGS84);
List<MapPoint> mapPoints = new List<MapPoint> { mapPoint };
MapView.Active.ShowElevationProfileGraph(mapPoints, profileParams);
}