22 lines
750 B
C#
22 lines
750 B
C#
|
|
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)
|
|||
|
|
{
|
|||
|
|
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;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|