17 lines
498 B
C#
17 lines
498 B
C#
using System.Globalization;
|
|
using System.Windows.Data;
|
|
|
|
namespace PortProxyTool.Wpf.Converters;
|
|
|
|
public class NullableUnknownToStringConverter : IValueConverter
|
|
{
|
|
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
|
{
|
|
return value == null ? "未知" : value.ToString();
|
|
}
|
|
|
|
public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
} |