Forum Xamarin.Forms


The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

How to implements Like & Dislike button

abdullahtahan.7433abdullahtahan.7433 SAMember ✭✭
edited June 2016 in Xamarin.Forms

hey guys i was wondering if you could help me to implement my project im facing a problem in my two buttons in my listview that if i click "like" i want to change the "dislike" button . the problem i'm facing that i can't get access to the other button since i can't call the X:name from my listview .

my view "like" button:



public async void SetLike (object sender, EventArgs e)
**Here i want to change the other button property **

Best Answer


  • abdullahtahan.7433abdullahtahan.7433 SAMember ✭✭

    what i've done so far is assigning both buttons to same click method and then get the current button
    var b = (Button)sender;
    Joke t = (Joke)b.CommandParameter;
    var x =((StackLayout)b.ParentView);

    i've upcast my button to ParentView but there's no name property i'll make my condition based on the sequence :)

    ddd.tiff 148.2K
  • alexleo_341alexleo_341 Member ✭✭

    you can share the solution

  • JohnHardmanJohnHardman GBUniversity admin

    @alexleo_341 said:
    you can share the solution

    If you look at the OP's profile, you will see that he hasn't been active on the forum for over a year, so it's unlikely that he will respond.

    Also, please see the forum rules and guidelines at regarding commenting on old posts (which typically means posts older than 6 months).

Sign In or Register to comment.