Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@davunderscorei
Last active August 29, 2015 13:58
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 davunderscorei/10140594 to your computer and use it in GitHub Desktop.
Save davunderscorei/10140594 to your computer and use it in GitHub Desktop.
public object Convert(object value, Type targetType, object parameter, CultureInfo culture, bool convertBack = false)
{
if (Converters.Count == 0 && value != null && value.GetType() == targetType)
{
return value;
}
foreach (IValueConverter converter in Converters)
{
object temp = converter.Convert(value, targetType, parameter, culture, convertBack);
if (temp != null)
{
return temp;
}
}
return null;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment