using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows.Data; using System.Windows; using System.Windows.Media; namespace Aitex.UI.RecipeEditor { class ErrContentConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { try { if (value == null) return " Valid"; var errors = value as List>; return string.Format(" {0} Error", errors.Count); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.Message); } return " Error"; } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { return null; } } }