BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
public class BoolToImageConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
var isAvailable = bool.Parse(value.ToString());
string imageName = isAvailable ? "Green.png": "Red.png";
return new BitmapImage(new Uri(string.Format(@"..\..\Images\{0}", imageName), UriKind.Relative));
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
} |
sfdatagrid.Columns.Add(new GridImageColumn() { MappingName = "IsAvailable", ValueBinding = new Binding() { Path = new PropertyPath("IsAvailable"), Converter = new BoolToImageConverter() } }); |