/// <summary> /// Initializes a new instance of the MainViewModel class. /// </summary> public MainViewModel(IStationNameService stationService, IStationService favStationService, IMyTrajectService ts, IPlannerService 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(); // }); }
/// <summary> /// Initializes a new instance of the viewmodel class. /// </summary> public DepartureTimesViewModel(IStationNameService stationService, INSApiService vertrektijdenService, IStationService favStationService) { _stationService = stationService; _vertrektijdenService = vertrektijdenService; _favStationService = favStationService; DataLoader = new DataLoader(); if (ViewModelBase.IsInDesignModeStatic) { // Code runs in Blend --> create design time data. CurrentStation = new Station() { Name = "Leeuwarden" }; _tijdList.Add(new Vertrektijd() { Tijd = DateTime.Now, Eindbestemming = "Amsterdam", IsVertrekspoorWijziging = false, Ritnummer = 123, Route = "Delft, Den Haag", TreinSoort = "Sprinter", Vertrekspoor = "2" }); _tijdList.Add(new Vertrektijd() { Tijd = DateTime.Now, Eindbestemming = "Delft", IsVertrekspoorWijziging = false, Ritnummer = 123, Route = "Delft, Den Haag", TreinSoort = "Intercity", Vertrekspoor = "2b" }); _tijdList.Add(new Vertrektijd() { Tijd = DateTime.Now, Eindbestemming = "Groningen", IsVertrekspoorWijziging = true, Ritnummer = 123, Route = "Amsterdam, Den Haag", TreinSoort = "Intercity", Vertrekspoor = "2b", VertragingTekst = "+5 min" }); } FavCommand = new RelayCommand(DoFavCommand); DeleteFavCommand = new RelayCommand(DoDeleteFavCommand); UpdateCommand = new RelayCommand(DoUpdate); _refreshTimer.Interval = new TimeSpan(0, 2, 0); _refreshTimer.Tick += _refreshTimer_Tick; _refreshTimer.Start(); }
/// <summary> /// Initializes a new instance of the AboutViewModel class. /// </summary> public MapViewModel() { ////if (IsInDesignMode) ////{ //// // Code runs in Blend --> create design time data. ////} ////else ////{ //// // Code runs "for real": Connect to service, etc... ////} StationService = SimpleIoc.Default.GetInstance <IStationService>(); StationNameService = SimpleIoc.Default.GetInstance <IStationNameService>(); //Stations = StationService.GetStations("NL"); }
public SearchResultsViewModel(IStationNameService stationService) { _stationService = stationService; if (ViewModelBase.IsInDesignModeStatic) { List <Station> stationDesignList = new List <Station>(); stationDesignList.Add(new Station() { Name = "Amsterdam Centraal" }); stationDesignList.Add(new Station() { Name = "Delft" }); foreach (var l in stationDesignList) { SuggestStations.Add(l); } } }
public LastStationService(IStationNameService stationNameService) { StationNameService = stationNameService; }