Hi
I'm using MVVM Light toolkit in my SL project.
I have a page(with the ViewModel setted as DataContext) with an XamRibbon which contains some ButtonTools and i'm setting the Command property of the ButtonTool to a RelayCommand declared in ViewModel. But the command is not triggered.
I did the same a Silverlight Button and it works!
Some could help me please?
Hello,
Thank you for your email. I have been looking into the behavior that you have described and it seems that the reason for the command to not execute is that the ButtonTool is not actually part of the visual tree (it is not a framework element). What I can suggest, in order to bind the Command of the ButtomTool, is creating an instance of your ViewModel in the Resources of the root element and use the Source of the binding in order to access command. I have created a sample application for you, that demonstrates how you can implement this approach.
Another approach that you can use in order to implement the functionality that you are looking for is following the approach that Devin Rader has described at the following blog post: https://es.infragistics.com/community/blogs/b/devin_rader/posts/extending-a-xamribbon-buttontool-to-execute-icommands
Please let me know if you need any further assistance on the matter.
Sincerely,
Krasimir
Developer Support Engineer
Infragistics
www.infragistics.com/support
I am just checking if you require any further assistance on the matter.
can you create the solution to work with Prism Framework using DelegateCommand? I could not able to get it to work.