I have a XamRibbon acting as a main application toolbar with button 'Save'. I am loading various UserControls into the main viewing area, each has a ViewModel behind it - acting as views.
1.How do you wire up XamRibbon ButtonTool to a ViewModel command in general?
2. Each of my user controls/views would like to wireup its SaveCommand RelayCommand to the main toolbar 'Save' button when is loaded. How would I accomplish something like that?
I am using NA 2010.2 at the moment and MVVM Light. Sample is appreciated. Thanks.
Hello Andre,
Thank you for your post. I have been looking into it and I can suggest you see this blogs and forum thread:
http://ko.infragistics.com/community/blogs/devin_rader/archive/2011/07/12/extending-a-xamribbon-buttontool-to-execute-icommands.aspx
and
http://ko.infragistics.com/community/blogs/ivo_evtimov/archive/2011/07/26/using-xamribbon-buttontool-in-mvvm-applications.aspx
http://ko.infragistics.com/community/forums/t/73050.aspx
where it is discussed how to use Commands in ButtonTool.
Hope this helps you.
Stefan, I've seen all posts that you have listed and neither pertains to my problem. First of all, my project is WPF (as opposed to SL) and XamRibbon ButtonTool (unlike SL version) works with ICommand just fine. Therefore, if I wanted to just execute the RelayCommand declared in MainWindowVM there is no problem. However, in my case, I want a XamRibbon button to 'route' the click notification to a 'child' user control ViewModel, not the MainWindowVM. What is the best way to get this done? Thanks.