publicvoid CreateTimeKeyframe(TimeSpan atTime)
{
var mapView = MapView.Active;
if (mapView != null)
return;
var animation = mapView.Map.Animation;
var timeTrack = animation.Tracks.OfType<TimeTrack>().First(); //There will always be only 1 TimeTrack in the animation.
timeTrack.CreateKeyframe(mapView.Time, atTime, ArcGIS.Core.CIM.AnimationTransition.Linear);
}