Files
DP44/Common/DTS.Common/.svn/pristine/9a/9a7553b3e8666353ee29bdf7fb9c1073db7af23b.svn-base
2026-04-17 14:55:32 -04:00

24 lines
814 B
Plaintext

using System;
using System.Windows.Data;
namespace DTS.Common.Converters
{
/// <summary>
/// Date converter that will display Table_NA when date is null, otherwise datetime [xaml responsible for formatting]
/// </summary>
public class NullableFloatConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if (value is double d) { return d; }
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;
}
}
}