Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save asimmon/edfc258ff44058a846a0 to your computer and use it in GitHub Desktop.
Save asimmon/edfc258ff44058a846a0 to your computer and use it in GitHub Desktop.
EventToCommand Xamarin Forms - Exempe EventArgs Converter
public class ItemTappedEventArgsConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
var eventArgs = value as ItemTappedEventArgs;
if (eventArgs == null)
throw new ArgumentException("Expected TappedEventArgs as value", "value");
return eventArgs.Item;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment