列类型是 tinyint,我需要转换为字符串,我Converter
用于 xaml
Text="{Binding confirmed,Converter={StaticResource UserConverter}}"
所以
class UserConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value != null)
{
var listOfInt = value as UInt32[];
return ""+listOfInt+"";
}
return "";
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return DependencyProperty.UnsetValue;
}
}
但它错了,请帮我写代码:)