I want to add RibbonApplicationMenuItem and the corresponding RibbonCommand from code-behind but I can't figure out where to specify the CanExecute and Executed.
This is how I specify the menu item and command and then link the command to the menu item.
Dim ribmnuitmTemplate As New Microsoft.Windows.Controls.Ribbon.RibbonApplicationMenuItem
Dim ribcmdTemplate As New Microsoft.Windows.Controls.Ribbon.RibbonCommand
ribcmdTemplate.LabelTitle = "This is the Command title"
ribcmdTemplate.LabelDescription = "This is the Command description"
ribmnuitmTemplate.Name = "This is the Item Name"
ribmnuitmTemplate.Command = ribcmdTemplate
ribmnuitmTemplate.CommandParameter = "Parameter"
In XAML I can specify the CanExecute and Executed on the RibbonCommand and it works fine, but these properties are not available from code-behind.
Any help is greatly appreciated!