Multibinding generates “Cannot set MultiBinding because MultiValueConverter must be specified”

后端 未结 3 403
一个人的身影
一个人的身影 2021-01-18 03:41

I have a button with binding which works fine, see below:

3条回答
  •  滥情空心
    2021-01-18 04:27

    you have to implement IMultiConverter

    public class SearchFilterConverter : IMultiValueConverter
    {
     public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
     {
        return new Tuple((String)values[0], (bool)values[1]);;
     }
     public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
    

    then create the resource in xaml

     
    

    then it should work

    
    

提交回复
热议问题