private void SelectDestination(FlightPoint flight, FlightWay way) { if (flight != null) { if (_route == null) { _route = new Route(); } switch (way) { case FlightWay.DEPARTURE: _route.Departure = flight.Iata; break; case FlightWay.ARRIVAL: _route.Arrival = flight.Iata; break; } if (_route.FormRoute()) { APrefListViewModel._viewModel.Routes.Add(_route); } } }
private void AutoSuggestBox_OnQuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args, FlightWay way) { if (args.ChosenSuggestion != null) { SelectDestination(args.ChosenSuggestion as FlightPoint, way); } }