public async void OnItemSelected(object sender, SelectedItemChangedEventArgs e)
        {
            var selectedItem = ((ListView)sender).SelectedItem;

            var page = new ProductItemViewPage(((Product)selectedItem).Id);

            await Navigation.PushAsync(page);
        }
Esempio n. 2
0
        private async void OnProductTapped(object sender, EventArgs e)
        {
            var selectedItem = ((ProductGridItemTemplate)sender).BindingContext;
            var productView  = new ProductItemViewPage
            {
                BindingContext = selectedItem
            };

            await Navigation.PushAsync(productView);
        }
        public ProductsCarouselPage()
        {
            InitializeComponent();

            var productsList = SampleData.Products;

            for (var i = 0; i < productsList.Count; i++)
            {
                var item = new ProductItemViewPage();
                item.BindingContext = new ProductViewModel(productsList[i].Id);

                Children.Add(item);
            }
        }