0
public bool SelectAll
    {
        get { return this.Get<bool>("SelectAll"); }
        set 
        {
            this.Set<bool>("SelectAll", value);
            if (this.SelectAllCommand.CanExecute(null))
                this.SelectAllCommand.Execute(value);
        }
    }

私のコードとして、チェックボックスが必要です-すべての機能を選択します。「すべて選択」を手動でクリックすると、SelectAllCommand を実行したいのですが、チェックボックスが自動的に選択されている場合、CanExecute は false を返すはずです....

CanExecuteにパラメータを渡す方法がわかりません...どうすれば完璧にできますか...?

前もって感謝します

4

1 に答える 1

1

さて、あなたのコードでは、現在パラメーターを渡していますが、そのパラメーターはたまたま null です。もっと正確にやりたくないですか?

if (this.SelectAllCommand.CanExecute(value))

?

于 2013-03-13T02:45:01.810 に答える