<Button Margin="222,256,130,19" Content="Add" Command="{Binding AddCustomer}">
<Button.CommandParameter>
<MultiBinding Converter="{StaticResource MyMultiConverter}">
<Binding ElementName="Name" Path="Text"></Binding>
<Binding ElementName="ID" Path="Text"></Binding>
</MultiBinding>
</Button.CommandParameter>
</Button>
public class MultiConverter : IMultiValueConverter
{
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
return values;
}
// ...
}
I've implemented IMultiValueConverter interface in my Class and Implemented the method Convert, but
When my button command executes the method "AddCustomer" it results in the command parameter ending up as object[] { null, null }.
I haven't found an explanation as to why I have to put return values.Clone(); in order to fix this issue