Answered by:
How to use ICommand in C++?

Question
-
Hi everyone.
How to use ICommand in C++? I mean, what should I do with the CanExecuteChanged. What kind of code should I put inside it? Is there some kind of CommandManager that should be notified.
Thank you very much.Claudio M. Souza Junior.
Sunday, October 23, 2011 2:17 PM
Answers
-
Hi Claudio,
please have a look at http://www.codeproject.com/KB/cpp/WinRTVisualCppDatabinding.aspx.
Regards,
Julien
- Proposed as answer by DavidLambMicrosoft employee, Moderator Tuesday, October 25, 2011 9:49 PM
- Marked as answer by ClaudioMSJr Wednesday, October 26, 2011 1:51 PM
Monday, October 24, 2011 9:14 AM
All replies
-
Hi Claudio,
please have a look at http://www.codeproject.com/KB/cpp/WinRTVisualCppDatabinding.aspx.
Regards,
Julien
- Proposed as answer by DavidLambMicrosoft employee, Moderator Tuesday, October 25, 2011 9:49 PM
- Marked as answer by ClaudioMSJr Wednesday, October 26, 2011 1:51 PM
Monday, October 24, 2011 9:14 AM -
Adding to Julien's answer.
I wrote the article he linked to and there is an example of an ICommand implementation in the article. But my example was kept simple and thus CanExecuteChanged is not fired. Note that for the majority of scenarios you never really need to fire CanExecuteChanged explicitly (except when you have very specialized requirements). So you should be able to use the implementation shown in the article without any issues.
http://blog.voidnish.com- Edited by Nishant Sivakumar Monday, October 24, 2011 2:37 PM
- Proposed as answer by DavidLambMicrosoft employee, Moderator Tuesday, October 25, 2011 9:49 PM
Monday, October 24, 2011 2:37 PM -
..and thumbs up for Nishant's article I must say!! Thanks
Tuesday, October 25, 2011 3:02 PM -
thank youWednesday, October 26, 2011 1:50 PM
-
Due to all the recent updates in the Beta version of Developer Studio 11, this project
http://www.codeproject.com/KB/cpp/WinRTVisualCppDatabinding.aspx.
no longer builds correctly. I have made a request in for a complete C++ / XAML data binding sample in the developer sample kit for win 8. Vote for this if you would like to see it.
Wednesday, April 25, 2012 3:17 PM