Version

MenuTool Class

A tool that can be placed inside a RibbonGroup, ApplicationMenu, ApplicationMenuFooterToolbar or another MenuTool. It contains a set of child tool items, elements that implement the IRibbonTool interface.
Syntax
'Declaration
 
Public Class MenuTool 
   Inherits MenuToolBase
   Implements IKeyTipContainer 
public class MenuTool : MenuToolBase, IKeyTipContainer  
Remarks

Tool items, elements that implement the IRibbonTool interface, that are added as children of a menu tool will be displayed inside the menu's System.Windows.Controls.Primitives.Popup when its MenuToolBase.IsOpen property is True.

MenuTools appear as one of 3 types of buttons (see the ButtonType property) inside a RibbonGroup or ApplicationMenuFooterToolbar but will appear as menu items inside another menu.

Note: A MenuTool can optionally contain one, and only one, GalleryTool. If the MenuTool is inside a RibbonGroup and it contains a GalleryTool and the ShouldDisplayGalleryPreview property is set to true then a preview of the GalleryItems will be displayed instead of the normal dropdown button.

Example
MenuTool Command

Dim menuTool As New MenuTool() 
menuTool.Caption = "Menu Tool" 
menuTool.ButtonType = MenuToolButtonType.Segmented 
menuTool.SmallImage = getImageSource("/Images/icons/Ribbon/QuickStyles_16x16.png") 
menuTool.LargeImage = getImageSource("/Images/icons/Ribbon/QuickStyles_32x32.png") 

menuTool.Items.Add("Menu Item 1") 
menuTool.Items.Add("Menu Item 2") 

menuTool.Command = ApplicationCommands.Paste
MenuTool menuTool = new MenuTool();
menuTool.Caption = "Menu Tool";
menuTool.ButtonType = MenuToolButtonType.Segmented;
menuTool.SmallImage= getImageSource("/Images/icons/Ribbon/QuickStyles_16x16.png");
menuTool.LargeImage= getImageSource("/Images/icons/Ribbon/QuickStyles_32x32.png");

menuTool.Items.Add("Menu Item 1");
menuTool.Items.Add("Menu Item 2");

menuTool.Command = ApplicationCommands.Paste;
<igRibbon:MenuTool
    
Caption= "Menu Tool"
    ButtonType= "Segmented" 
    SmallImage= "Images\icons\Ribbon\QuickStyles_16x16.png" 
    
LargeImage= "Images\icons\Ribbon\QuickStyles_32x32.png" 
    
Command= "Paste"
 
   CommandTarget="{Binding ElementName=textBox}"
    
>
    
<TextBlock Text="Menu Item 1"/>
    
<TextBlock Text="Menu Item 2"/>
</igRibbon:MenuTool>
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also