我已绑定到ICommand
按钮看起来停用,直到我点击的东西
<Button Content="Remove" Command="{Binding RemoveCommand}" x:Name="btnRemove" Visibility="Collapsed" />
后一些任务按钮完成后,我做了按钮可见,但他们看停用,直到我点击的东西,为什么就是它?该RemoveCommand
看起来像下面
public ICommand RemoveCommand
{
get
{
if (_removeCommand == null)
{
_removeCommand = new RelayCommand(() =>
{
if (RemoveRequested != null)
RemoveRequested(this, EventArgs.Empty);
},() =>
{
// CanExecute Callback
if (Status == WorkStatus.Processing || Status == WorkStatus.Pending)
{
Debug.WriteLine("Returning False" + Status); return false;
}
Debug.WriteLine("Returning True"); return true; // After uploads, this returns True, in my Output Window.
});
}
return _removeCommand;
}
上传后
,该CanExecute
回调返回True,所以按钮应该被启用,但是直到我点击的东西,它看起来禁用,为什么会出现这种情况?
我已经在Status的设置中有这个http://pastebin.com/w6901n06 – 2010-11-29 11:50:56