예제 #1
0
        private async void Handle_ItemTapped(object sender, ItemTappedEventArgs e)
        {
            if (e.Item == null)
            {
                return;
            }

            var weatherPage = new WeatherPage();

            weatherPage.BindingContext = e.Item;
            await Navigation.PushAsync(weatherPage);

            ((ListView)sender).SelectedItem = null;
        }
예제 #2
0
        public CitiesListPage(WeatherPage parent)
        {
            try {
                InitializeComponent();
                _parent = parent;

                var Cities = App.Database.GetCities();
                citiesList          = new ObservableCollection <City>();
                this.BindingContext = Cities;

                foreach (var city in Cities)
                {
                    citiesList.Add(city);
                }

                MyListView.ItemsSource = citiesList;
            }
            catch (Exception npe)
            {
                System.Diagnostics.Debug.WriteLine(npe);
            }
        }
예제 #3
0
        private void Weather_OnClicked(object sender, EventArgs e)
        {
            WeatherPage weather = new WeatherPage();

            this.Navigation.PushAsync(weather);
        }