Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of the MainViewModel class.
        /// </summary>
        public MainViewModel(IStationService stationService, IFavStationService favStationService, ITrajectService ts, ISearchHistoryService sh)
        {
            _stationService       = stationService;
            _favStationService    = favStationService;
            _trajectService       = ts;
            _searchHistoryService = sh;

            if (ViewModelBase.IsInDesignModeStatic)
            {
                List <Station> stationDesignList = new List <Station>();
                stationDesignList.Add(new Station()
                {
                    Name = "Amsterdam Centraal"
                });
                stationDesignList.Add(new Station()
                {
                    Name = "Delft"
                });

                //FavStations = stationDesignList;
            }

            //Messenger.Default.Register<string>(this, "FavChanged", FavChangedReceived);

            LoadFavStations();

            //Task.Run(() =>
            // {
            this.Gps.Initialize();
            // });
        }
 public TrajectsController(IAdministratorService administratorService, ICompanyService companyService,
                           IEmployeeService employeeService, ISessionService sessionService, ITrajectService trajectService)
 {
     this.administratorService = administratorService;
     this.companyService       = companyService;
     this.employeeService      = employeeService;
     this.sessionService       = sessionService;
     this.trajectService       = trajectService;
 }
Esempio n. 3
0
        public TravelAdviceViewModel(IPlannerService plannerService, ITrajectService trajectService, ISearchHistoryService searchHistoryService)
        {
            _plannerService       = plannerService;
            _trajectService       = trajectService;
            _searchHistoryService = searchHistoryService;

            if (ViewModelBase.IsInDesignModeStatic)
            {
                ReisMogelijkheden = new List <ReisMogelijkheid>()
                {
                    new ReisMogelijkheid()
                    {
                        Optimaal             = true,
                        AantalOverstappen    = 2,
                        GeplandeAankomstTijd = DateTime.Now,
                        GeplandeVertrekTijd  = DateTime.Now,
                        GeplandeReisTijd     = "2:05"
                    },
                    new ReisMogelijkheid()
                    {
                        Optimaal             = true,
                        AantalOverstappen    = 1,
                        GeplandeAankomstTijd = DateTime.Now.AddHours(1),
                        GeplandeVertrekTijd  = DateTime.Now,
                        GeplandeReisTijd     = "7:05"
                    }
                };

                CurrentSearch = new PlannerSearch()
                {
                    DateTime    = DateTime.Now,
                    NaarStation = new Station()
                    {
                        Name = "Delft"
                    },
                    VanStation = new Station()
                    {
                        Name = "Amsterdam"
                    },
                    Type = "Vertrek"
                };
            }


            AddCommand    = new RelayCommand(AddCommandAction);
            DeleteCommand = new RelayCommand(DeleteCommandAction);
        }
        public TravelAdviceSingleViewModel(ITrajectService trajectService, IPrijsService prijsService)
        {
            _trajectService = trajectService;
            _prijsService   = prijsService;

            PrijsLoader = new DataLoader(true);

            if (ViewModelBase.IsInDesignModeStatic)
            {
                this.ReisMogelijkheid = new ReisMogelijkheid()
                {
                    Optimaal             = true,
                    AantalOverstappen    = 2,
                    GeplandeAankomstTijd = DateTime.Now,
                    GeplandeVertrekTijd  = DateTime.Now,
                    GeplandeReisTijd     = "2:05"
                };
            }

            AddCommand    = new RelayCommand(AddCommandAction);
            DeleteCommand = new RelayCommand(DeleteCommandAction);
        }