3
IMultiValueConverter를 통해 여러 값을 명령 매개 변수로 전달하려고합니다. 값은 변환기를 통과 할 때 올바른 값을 갖지만 일단 Can_Execute() 및 Execute() 명령이 호출되면 NULL 개체 배열을 가져옵니다. 어떤 아이디어?IMultiValueConverter 값은 괜찮지 만 CommandParameter는 null입니다.
는는 XAML :
는<Button Content="+" HorizontalAlignment="Right" VerticalAlignment="Top" Width="23" Height="23" Margin="0,0,0,0">
<Button.CommandParameter>
<MultiBinding Converter="{StaticResource Converter_MultipleValues}">
<Binding/>
</MultiBinding>
</Button.CommandParameter>
<Button.Command>
<Binding Path="Command_Add_Files" Source="{StaticResource Vm_FileList}"/>
</Button.Command>
</Button>
IMultiValueConverter 클래스 : 나는 MultiBinding 및 변환기를 사용하지 않은,하지만 난 MultiBinding을 필요로 할 때 코드는 잘 작동
class cvt_multivalue : IMultiValueConverter {
public object Convert (object[] Values, Type Target_Type, object Parameter, CultureInfo culture) {
if (Target_Type != typeof (object)) throw new NotSupportedException();
return Values;
}
public object [] ConvertBack (object Value, Type [] Target_Type, object Parameter, CultureInfo culture) {
throw new NotSupportedException();
}
}
은 그래서 몇 가지 추가를 전달할 수 있습니다 정보를 명령에 전달하십시오.