В моем DataGridColumnHeaderStyle у меня есть следующее MultiBinding:
<Setter Property="Command" Value="{Binding DataContext.AddFilterColumnCommand, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}" />
<Setter Property="CommandParameter">
<Setter.Value>
<MultiBinding Converter="{StaticResource MultiCommandParameterConverter}">
<Binding Path="Content" RelativeSource="{RelativeSource Mode=Self}" />
<Binding Path="Column.Binding.Path.Path" RelativeSource="{RelativeSource Mode=Self}" />
</MultiBinding>
</Setter.Value>
</Setter>
У меня проблемы со второй привязкой.Он всегда возвращает {{DependencyProperty.UnsetValue}}
Однако, если во время работы приложения я изменяю режим RelativeSource на что-то другое, то снова снова работает нормально.
Я почесал голову над этимНекоторое время и, не глядя на конец других вопросов SO и используя Google, я не могу найти ответ на вопрос, почему это так и как я могу это преодолеть.
РЕДАКТИРОВАТЬ: Это мой код конвертера в случае, если онпомогает
class MultiCommandParameterConverter : IMultiValueConverter
{
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{ return values.Clone(); }
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
{ return new object[] { value }; }
}