public ForecastPage() { InitializeComponent(); App app = (App)Application.Current; WeatherService weatherService = app.GetService <WeatherService>(); WeatherLocationService weatherLocationService = app.GetService <WeatherLocationService>(); _viewModel = new ForecastViewModel(weatherService, weatherLocationService); BindingContext = _viewModel; }
public HomePage() { InitializeComponent(); App myApp = ((App)Application.Current); WeatherService weatherService = myApp.GetService <WeatherService>(); WeatherLocationService weatherLocationService = myApp.GetService <WeatherLocationService>(); AppPreferencesService appPreferencesService = myApp.GetService <AppPreferencesService>(); _viewModel = new HomeViewModel(weatherService, weatherLocationService, appPreferencesService); BindingContext = _viewModel; }
public RadarPage() { InitializeComponent(); App app = ((App)Application.Current); RadarService radarService = app.GetService <RadarService>(); WeatherLocationService weatherLocationService = app.GetService <WeatherLocationService>(); AppPreferencesService appPreferencesService = app.GetService <AppPreferencesService>(); _viewModel = new RadarViewModel(radarService, weatherLocationService, appPreferencesService); BindingContext = _viewModel; }