Skip to content

Instantly share code, notes, and snippets.

@refre
Last active March 21, 2021 09:40
this is the function that manages the click
private async void Button_Clicked(object sender, EventArgs e)
{
var carousel = this.Content.FindByName<CarouselView>("MyCarrousel");
var listOfControls = carousel.VisibleViews;
var gridControl = listOfControls[0] as Grid;
var controlsInsideGrid = gridControl.Children;
var labelName = controlsInsideGrid[1] as Label;
var button = controlsInsideGrid[2] as Button;
button.BackgroundColor = Color.Blue;
await DisplayAlert("Message", $"The displayed color is {labelName.Text}", "Ok");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment