public Convert ( object value, |
||
value | object | The value. |
targetType | Type of the target. | |
parameter | object | The parameter. |
culture | The culture. | |
return | object |
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (targetType != typeof(Visibility))
{
throw new InvalidOperationException("The target must be a visibility enumerator");
}
return string.IsNullOrWhiteSpace(value?.ToString()) ? Visibility.Collapsed : Visibility.Visible;
}