Okay so I am currently trying to make checkboxes based on if a string can be soon or not, however the data for each row in my grid will be different everytime so I can’t set it to check one specific String, I was thinking along the lines of checking if that string was not nulled or empty but I don’t know how to do this, I have an error in my code on the if (string.Equals line as I am unsure how to finish this off.
public class StringToVisibilityConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value != null && value is string)
{
var input = (string)value;
if (string.Equals
{
return Visibility.Collapsed;
}
else
{
return Visibility.Visible;
}
}
return Visibility.Visible;
}
.NET 4.0:
.NET pre 4.0:
Though, I would write the logic differently (some checks are not needed):