private void Delete(Lado item) { if (contexto.IsDeleting) { return; } contexto.IsDeleting = true; EliminarLadoInicio(item.lado); }
private void rightImage_BindingContextChanged(object sender, EventArgs e) { Image rightImage = sender as Image; Grid grid1 = (Grid)rightImage.Parent; Grid grid2 = (Grid)grid1.Parent; Grid grid3 = (Grid)grid2.Parent; SwipeView swipeView = (SwipeView)grid3.Parent; VisualContainer visualContainer = (VisualContainer)swipeView.Parent; ExtendedScrollView extendedScrollView = (ExtendedScrollView)visualContainer.Parent; SfListView sfListView = (SfListView)extendedScrollView.Parent; Collection <Lado> Source = (Collection <Lado>)sfListView.ItemsSource; Lado item = Source[itemIndex]; DeleteEvent evento = new DeleteEvent(item); evento.executeEvent += Evento_executeEvent; (rightImage.Parent as View).GestureRecognizers.Clear(); (rightImage.Parent as View).GestureRecognizers.Add(new TapGestureRecognizer() { Command = evento }); rightImage.Source = "Delete.png"; }
private void Evento_executeEvent(Lado input) { Delete(input); }