'Declaration Public Class MenuTool Inherits MenuToolBase Implements IKeyTipContainer
public class MenuTool : MenuToolBase, IKeyTipContainer
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.
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;
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