Exemplo n.º 1
0
        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;
        }
Exemplo n.º 2
0
        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;
        }
Exemplo n.º 3
0
        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;
        }