我遇到以下问题:
我有命令
CancelNewFilmCommand
代码:
Select
CAST(readOn as date) [date],
COUNT(*) [read]
FROM Mails m
WHERE m.Reference=@Reference
GROUP BY CAST(readOn as date)
ORDER BY CAST(readOn as date) ASC
and I get something like this:
sDate read
NULL 360
2016-05-05 67
2016-05-06 123
2016-05-07 84
2016-05-08 62
2016-05-09 89
2016-05-10 17
2016-05-11 12
2016-05-12 8
2016-05-13 4
2016-05-14 4
现在在CancelNewFilmCommand的执行中我调用了AddNewFilmWindow命令的CanExecute。我在初始化时提供了CancelNewFilmCommand,并将其设置为私有字段。问题是,AddNewFilmWindow.CanExecute(this);没做什么。我需要将它绑定到AddNewFilmWindowCommand的灰色按钮,并且无法弄清楚如何。
有人可以帮忙吗?我试图解决这一整天没有成功:/
答案 0 :(得分:0)
您应该运行AddNewFilmWindow.RaiseCanExecuteChanged()
而不是AddNewFilmWindow.CanExecuteChanged(this)