Esempio n. 1
0
 private void likeButton_Clicked(object sender, EventArgs e)
 {
     try
     {
         SwipeView1.InvokeSwipe((MLToolkit.Forms.SwipeCardView.Core.SwipeCardDirection)MLToolkit.Forms.SwipeCardView.Core.SwipeCardDirection.Right);
         auth.AddLoveUser(((User)SwipeView1.TopItem).Id);
     }
     catch
     {
         DisplayAlert("Alert", "User doesn't exists", "Ok");
     }
 }
        private async void likeButton_Clicked(object sender, EventArgs e)
        {
            await SwipeView1.InvokeSwipe((MLToolkit.Forms.SwipeCardView.Core.SwipeCardDirection) MLToolkit.Forms.SwipeCardView.Core.SwipeCardDirection.Right);

            SwipeView1.SupportedSwipeDirections = SwipeCardDirection.Right;
            var animal = await App.Database.GetAnimalAsync();

            var        a  = animal.ElementAt(iterator);
            UserAnimal ua = new UserAnimal
            {
                UserId   = Database.LoggedUser.UserId,
                AnimalId = a.AnimalId
            };
            await App.Database.SaveUserAnimalAsync(ua);


            iterator++;
        }
        private async void nopeButton_Clicked(object sender, EventArgs e)
        {
            await SwipeView1.InvokeSwipe((MLToolkit.Forms.SwipeCardView.Core.SwipeCardDirection) MLToolkit.Forms.SwipeCardView.Core.SwipeCardDirection.Left);

            iterator++;
        }