Skip to content

Instantly share code, notes, and snippets.

@grimorde
Created February 20, 2020 12:20
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 grimorde/7711ccfb3281fe0b58dca7752b509c9b to your computer and use it in GitHub Desktop.
Save grimorde/7711ccfb3281fe0b58dca7752b509c9b to your computer and use it in GitHub Desktop.
String Has Value Converter
public class StringHasValueConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value == null) return false;
return !string.IsNullOrEmpty(value.ToString());
}
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