Use Image and set checked and unchecked image to it source dynamically
Design Side:
Design Side:
<Image Source="unchecked_checkbox" > <Image.GestureRecognizers > <TapGestureRecognizer Tapped="TapGestureRecognizerForCheckStaff" /> </Image.GestureRecognizers> </Image>
Coding Side:
private void TapGestureRecognizerForCheckStaff(object sender, EventArgs e)
{ Image img = (Image)sender; var selectedImage = img.Source as FileImageSource; if (selectedImage.File == "unchecked_checkbox") { // perform action checkbox is checked; img.Source = "checked_checkbox"; } if (selectedImage.File == "checked_checkbox") { // perform action when checkbox is unchecked img.Source = "unchecked_checkbox"; } }
No comments:
Post a Comment