Created
November 20, 2015 15:56
-
-
Save asimmon/edfc258ff44058a846a0 to your computer and use it in GitHub Desktop.
EventToCommand Xamarin Forms - Exempe EventArgs Converter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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