using System; using System.Windows.Data; namespace DTS.Common.Converters { /// /// Date converter that will display Table_NA when date is null, otherwise datetime [xaml responsible for formatting] /// public class NullableFloatConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { return value is float ft ? ft : (object)string.Empty; } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { return value is float ft ? ft : (object)string.Empty; } } }