質問

私は(コマンドパラメータなど)コマンドにIMultiValueConverterを通じて複数の値を渡すためにしようとしています。値は、彼らがコンバータを介して行くときに正しいですが、Can_Execute一度()と私はヌルオブジェクトの配列を取得し、comandsが呼び出される()を実行します。任意のアイデア?

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クラスます:

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 ();
        }
    }

私はMultiBindingのコンバータを使用していないときにコードがうまく働いたが、私は、コマンドにいくつかの追加情報を渡すことができますので、私はMultiBindingのを必要とします。

役に立ちましたか?

解決

コンバータからだけではなく、値の

Values.Cloneを返す()は、問題を修正するようだが、それはやっている...

最高のものである場合、私はわからないんだけど
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top