public FlightLineViewModel(AirportSelectorViewModel airportSelector, AirportViewModel departureAirport, AirportViewModel arrivalAirport)
 {
     DepartureAirport = departureAirport;
     ArrivalAirport   = arrivalAirport;
     _airportSelector = airportSelector;
     _airportSelector.PropertyChanged += PlaneIndicator_PropertyChanged;
 }
 public FlightPlanificatorViewModel(CompanyViewModel company, HubViewModel hubViewModel)
 {
     Company = company;
     AirportSelectorViewModel = new AirportSelectorViewModel(company, hubViewModel);
     PassengerDemand          = new DemandClass();
     PlaneConfigurationList   = new PlaneConfigurationList(() => AirportSelectorViewModel.AvailablePlanes);
     ConfigurationResult      = new PlaneConfigurationListResult();
 }
Esempio n. 3
0
 public AdvancedAirportSelectorViewModel(AirportSelectorViewModel baseViewModel)
 {
     _baseViewModel = baseViewModel;
     _baseViewModel.PropertyChanged += (sender, args) =>
     {
         if (Equals(args.PropertyName, ReflectorPropertyName.GetPropertyName <AirportSelectorViewModel>(model => model.PlaneIndicator)))
         {
             RefreshAvailableDistanceIndicator();
         }
     };
 }
        private void AddNewHubExecute()
        {
            Views.SelectAirport window = new Views.SelectAirport();
            var data = new AirportSelectorViewModel(this, null);

            window.DataContext = data;
            try
            {
                bool?result = window.ShowDialog();
                if (result.HasValue && result.Value)
                {
                    if (data.SelectedFlightLine != null)
                    {
                        HubViewModel newHub = new HubViewModel(this, data.SelectedFlightLine.DepartureAirport.Airport);
                        Hubs.Add(newHub);
                        SelectedHub = newHub;
                    }
                }
            }
            catch (Exception ex)
            {
                Console.Write(ex.Message);
            }
        }