C# 多重绑定错误

C# 多重绑定错误,c#,wpf,multibinding,C#,Wpf,Multibinding,我之前发布了我的问题: 我通过构建转换器解决了这个问题 XAML: 其中str1,2,3,。。。这是一根绳子。当我运行它时,我得到一个错误: An object of the type "Test_MultiBinding.myConverter" cannot be applied to a property that expects the type "System.Windows.Data.IMultiValueConverter" 请帮忙 对于a,您必须实现而不是IValueConv

我之前发布了我的问题:

我通过构建转换器解决了这个问题

XAML:

其中str1,2,3,。。。这是一根绳子。当我运行它时,我得到一个错误:

An object of the type "Test_MultiBinding.myConverter" cannot be applied to a property that expects the type "System.Windows.Data.IMultiValueConverter"
请帮忙

对于a,您必须实现而不是
IValueConverter

public class myConverter : IMultiValueConverter
对于a,您必须实现而不是
IValueConverter

public class myConverter : IMultiValueConverter

好的,我编辑了它并再次运行,我得到了以下错误:Test_MultiBinding.myConverter“未实现接口成员”System.Windows.Data.IMultiValueConverter.ConvertBack(对象,系统.Type[],对象,系统.Globalization.CultureInfo)’如果您要转换回,您也需要实现ConvertBack部分。@user2627651当然了。您必须实现成员。
Convert
ConvertBack
的签名与IValueConverter中的签名不同。请参见链接中的示例。@user2627651它只是
Object[]ConvertBack
而不是
Object ConvertBack
。好的,谢谢。如果我不需要回来?我是说我想要单向装订。我在XAML:Mode=“OneWay”中尝试了它,但我仍然需要ConvertBack确定我编辑了它并再次运行,我得到了以下错误:Test_MultiBinding.myConverter“未实现接口成员”System.Windows.Data.IMultiValueConverter.ConvertBack(object,System.Type[],object,System.Globalization.CultureInfo)如果您要转换回来,您还需要实现ConvertBack部分。@user2627651当然可以。您必须实现成员。
Convert
ConvertBack
的签名与IValueConverter中的签名不同。请参见链接中的示例。@user2627651它只是
Object[]ConvertBack
而不是
Object ConvertBack
。好的,谢谢。如果我不需要回来?我是说我想要单向装订。我在XAML:Mode=“OneWay”中尝试了它,但我仍然必须返回
public class myConverter : IMultiValueConverter
public class MultiStringConverter : IMultiValueConverter
{
    public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
    {
        string result = "";

        foreach(object value in values)
            result += value.ToString();

        return result;
    }

    public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
    {
        throw new NotImplementedException();
    }
}