Exemplo n.º 1
0
        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);
                }
            }
        }
Exemplo n.º 2
0
 private void AutoSuggestBox_OnQuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args, FlightWay way)
 {
     if (args.ChosenSuggestion != null)
     {
         SelectDestination(args.ChosenSuggestion as FlightPoint, way);
     }
 }