Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bbenetskyy/6ec7e95d33df1fda8f0741bea8cfc497 to your computer and use it in GitHub Desktop.
Save bbenetskyy/6ec7e95d33df1fda8f0741bea8cfc497 to your computer and use it in GitHub Desktop.
private void TapGestureRecognizer_Tapped(System.Object sender, Microsoft.Maui.Controls.TappedEventArgs e)
{
if (e.Parameter is SelectableModel selectable)
{
selectable.IsSelected = !selectable.IsSelected;
}
else if (e.Parameter is QuestionableModel questionable)
{
var frame = sender as Frame;
var label = frame.Children.First() as Label;
questionable.Answer = label.Text.Equals("yes", StringComparison.InvariantCultureIgnoreCase)
? Answer.Yes
: Answer.No;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment