I am working with xamarin formats and trying to create a navigation menu. I need to set a new image when I click on a cell. I have a blinking when I replace the image.
I am creating an image:
var image = new Image { Source = "Image.png"; }
I add it to my grid
var profileTapRecognizer = new TapGestureRecognizer(); profileTapRecognizer.Tapped += (sender, e) => { ItemClicked(sender as ITaggedCell); }; image.GestureRecognizers.Add(profileTapRecognizer); grid.Children.Add(image, i, 0);
And in ItemClicked, I change the source and blink before setting a new image:
image.Source = "NewImage.png"
I tried
image.BatchBegin() image.Source = "NewImage.png" image.BatchCommit()
and thus How do I change the image source when I click on the ListView in xamarin.forms?
What is the best way to change the image?
source share