MiniToolbar element
Represents a contextual toolbar.
Usage
<MiniToolbar
Name = "xs:string">
child elements
</MiniToolbar>
Attributes
Attribute | Type | Required | Description |
---|---|---|---|
Name |
xs:string |
Yes |
Child elements
Element | Description |
---|---|
MenuGroup |
Must occur at least once |
Parent elements
Element |
---|
ContextPopup.MiniToolbars |
Remarks
Optional.
May occur one or more times for each ContextPopup.MiniToolbars.
Unlike the ContextMenu element, the MiniToolbar remains visible when an item on the toolbar is clicked.
If displayed without a ContextMenu, the MiniToolbar fades as the mouse pointer is moved away.
Note
Due to this fading behavior, a ContextMenu should be displayed in close proximity to the mouse pointer.
Because controls in the MiniToolbar are not keyboard accessible, the Commands they expose should be available elsewhere in the Ribbon UI.
Examples
The following example demonstrates the basic markup for a ContextPopup View.
This section of code shows a set of MiniToolbar control declarations.
<ContextPopup>
<!--
The MiniToolbars and Context Menus are the basic ingredients for
the contextual UI popup.
Mix-and-match and associate each combination with a ContextMap Command
invoked in code.
-->
<ContextPopup.MiniToolbars>
<MiniToolbar Name="MiniToolbar1">
<MenuGroup Class="MajorItems">
<Button CommandName="cmdCut" />
<Button CommandName="cmdCopy" />
<Button CommandName="cmdPaste" />
</MenuGroup>
<MenuGroup>
<ToggleButton CommandName="cmdToggleButton" />
<DropDownButton CommandName="cmdButtons">
<MenuGroup>
<Button CommandName="cmdButton1" />
<Button CommandName="cmdButton2" />
<Button CommandName="cmdButton3" />
</MenuGroup>
</DropDownButton>
</MenuGroup>
</MiniToolbar>
<MiniToolbar Name="MiniToolbar2">
<MenuGroup>
<Button CommandName="cmdButton1" />
<Button CommandName="cmdButton2" />
<Button CommandName="cmdButton3" />
</MenuGroup>
</MiniToolbar>
</ContextPopup.MiniToolbars>
<ContextPopup.ContextMenus>
<ContextMenu Name="ContextMenu1">
<MenuGroup>
<Button CommandName="cmdCut" />
<Button CommandName="cmdCopy" />
<Button CommandName="cmdPaste" />
</MenuGroup>
</ContextMenu>
<ContextMenu Name="ContextMenu2">
<MenuGroup>
<ToggleButton CommandName="cmdToggleButton" />
</MenuGroup>
<MenuGroup>
<Button CommandName="cmdButton1" />
<Button CommandName="cmdButton2" />
<Button CommandName="cmdButton3" />
</MenuGroup>
</ContextMenu>
<ContextMenu Name="ContextMenu4">
<MenuGroup>
<Button CommandName="cmdCut" />
<Button CommandName="cmdCopy" />
<Button CommandName="cmdPaste" />
</MenuGroup>
<MenuGroup>
<ToggleButton CommandName="cmdToggleButton" />
</MenuGroup>
<MenuGroup>
<Button CommandName="cmdButton1" />
<Button CommandName="cmdButton2" />
<Button CommandName="cmdButton3" />
</MenuGroup>
</ContextMenu>
</ContextPopup.ContextMenus>
<ContextPopup.ContextMaps>
<ContextMap CommandName="cmdContextMap1"
ContextMenu="ContextMenu1"/>
<ContextMap CommandName="cmdContextMap2"
ContextMenu="ContextMenu2"
MiniToolbar="MiniToolbar1"/>
<ContextMap CommandName="cmdContextMap3"
MiniToolbar="MiniToolbar2"/>
<ContextMap CommandName="cmdContextMap4"
ContextMenu="ContextMenu4"/>
</ContextPopup.ContextMaps>
</ContextPopup>
Element information
- Minimum supported system: Windows 7
- Can be empty: No