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

好吧,在您的代码中,您当前正在传递一个参数,该参数恰好为空。所以你不更准确地想做

if (this.SelectAllCommand.CanExecute(value))

?

于 2013-03-13T02:45:01.810 回答