init
This commit is contained in:
21
Common/DTS.CommonCore/Converters/NullableFloatConverter.cs
Normal file
21
Common/DTS.CommonCore/Converters/NullableFloatConverter.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user