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:

<Button.Triggers>



</Button.Triggers>

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

Best Answer

Answers

  • 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 mod

    @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 https://forums.xamarin.com/discussion/87290/xamarin-forum-rules-and-guidelines regarding commenting on old posts (which typically means posts older than 6 months).

Sign In or Register to comment.