int numPoints = 20;
if (!MapView.Active.CanShowElevationProfileGraph())
return;
// show the elevation profile
// use the default ground elevation surface
MapView.Active.ShowElevationProfileGraph(startPt, endPt, numPoints);
// find a specific elevation surface layer
var tinLayer = MapView.Active.Map.GetElevationSurfaceLayers().FirstOrDefault(l => l.Name == "TIN");
// set up the params
var elevProfileParams = new ElevationProfileParameters();
elevProfileParams.SurfaceLayer = tinLayer;
elevProfileParams.Densify = false;
// show the elevation profile using the params
MapView.Active.ShowElevationProfileGraph(startPt, endPt, numPoints, elevProfileParams);