0

I have a CollectionViewSource populated with business objects from a database. Setting the AutoCompleteBox ValueMemberPath="LNAME" works as intended for all last names. However, I would like to search first name and order number concurrently without having to resort to radio buttons or a dropdown to define search type.

I have changed ValueMemberPath to ValueMemberBinding:

ItemsSource="{Binding Source={StaticResource TheCollectionViewSource}}"
ValueMemberBinding="{Binding Converter={StaticResource ValueMemberPathConverter}}"

I am not sure how to combine the LNAME, FNAME etc in the converter

public class Converter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return foo;
        }
        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return foo;
        }
}
BCCode
  • 94
  • 1
  • 6

1 Answers1

1
public Binding ValueMemberBinding
    {
      get
      {
        return _valueBindingEvaluator != null ?
          _valueBindingEvaluator.ValueBinding : null;
      }
      set
      {
        if (_valueBindingEvaluator == null)
        {
          _valueBindingEvaluator = new BindingEvaluator<string>();
          AddLogicalChild(_valueBindingEvaluator);
        }
        _valueBindingEvaluator.ValueBinding = value;
      }
    }
Sanjay Patel
  • 955
  • 1
  • 8
  • 22