public static FlightPlanModel FromCoreFlightPlan(Core.FlightPlan flightPlan) { var model = new FlightPlanModel(); model._flightPlan = flightPlan; model._origin = flightPlan.Origin; model._destination = flightPlan.Destination; if (flightPlan.Waipoints != null) { var waypoints = flightPlan.Waipoints.Select(wp => WaypointModel.FromCoreWaypoint(wp)); model._waypoints = new ObservableCollection <WaypointModel>(waypoints); } return(model); }