I have a swipe button that is connected to a clicked trigger to change the text and button. On iOS it only changes the color and text of the specific button that was pressed. On Android, it changes all of the buttons colors and text. This is how I have the trigger setup:
<
Button.Triggers
>
<
EventTrigger
Event
=
"Clicked"
>
<
local:TasksButtonTriggerAction
/>
</
EventTrigger
>
</
Button.Triggers
>
And this is the TasksButtonTriggerAction implementation:
public
class
TasksButtonTriggerAction : TriggerAction<Button>
{
protected
override
void
Invoke(Button sender)
{
if
(sender.Text.ToLower() ==
"start"
)
{
sender.BackgroundColor = Color.Red;
sender.Text =
"Complete"
;
sender.TextColor = Color.White;
}
else
{
sender.BackgroundColor = Color.FromHex(
"#80BD01"
);
sender.Text =
"Start"
;
sender.TextColor = Color.FromHex(
"#15315A"
);
}
}
}