BinaryRibbonQuickAccessToolBar
The quick access toolbar: a short row of small commands – Save, Undo, Redo – kept on show above the ribbon's tabs, or below the ribbon, whichever tab is selected.
public class BinaryRibbonQuickAccessToolBar : ItemsControl, IBinaryRibbonKeyTipControl
Inherits from / implements: ItemsControl, IBinaryRibbonKeyTipControl
Remarks
Assign it to BinaryRibbonBarPanel.QuickAccessToolBar. Ribbon commands among its
items – BinaryRibbonButton, BinaryRibbonToggleButtonControl,
BinaryRibbonDropDownButton and the like – go on the bar, drawn small (a picture
alone). Any other item, such as a MenuItem, goes into the toolbar's drop-down menu,
between HeaderContent (by default a "Customize the QAT" heading) and
FooterContent; the drop-down arrow appears only when there is such an item.
Users add commands from the ribbon by right-clicking them, and the ribbon can save and restore
their choice (BinaryRibbonBarPanel.GetQuickAccessToolBarState). Whether the toolbar sits
above or below the ribbon is the ribbon's
BinaryRibbonBarPanel.ToolbarPlacementLocation; its height in the caption is the
window's BinaryRibbonWindow.QATPanelHeight.
Examples
<bm:BinaryRibbonBarPanel.QuickAccessToolBar>
<bm:BinaryRibbonQuickAccessToolBar>
<bm:BinaryRibbonButton SmallImage="Images/Save16.png" ToolTip="Save (Ctrl+S)" Command="ApplicationCommands.Save" />
<bm:BinaryRibbonButton SmallImage="Images/Undo16.png" ToolTip="Undo" Command="ApplicationCommands.Undo" />
<bm:BinaryRibbonButton SmallImage="Images/Redo16.png" ToolTip="Redo" Command="ApplicationCommands.Redo" />
<MenuItem Header="Show below the ribbon" Click="OnQuickAccessBelow" />
</bm:BinaryRibbonQuickAccessToolBar>
</bm:BinaryRibbonBarPanel.QuickAccessToolBar>See also
Members at a glance
| Constructors | |
|---|---|
BinaryRibbonQuickAccessToolBar | Creates an empty quick access toolbar. A click on any of its commands or menu items closes its drop-downs. |
| Properties | |
FooterContent | Gets or sets what is shown at the foot of the toolbar's drop-down menu, below its menu items. |
FooterDataTemplate | Gets or sets the template that draws FooterContent. |
HasContentOverflowItems | Gets or sets whether some commands did not fit and were moved to the overflow drop-down. |
HasItems | Gets or sets whether the toolbar has menu items – items other than ribbon commands – to show in its drop-down menu. |
HeaderContent | Gets or sets what is shown at the top of the toolbar's drop-down menu, above its menu items. |
HeaderDataTemplate | Gets or sets the template that draws HeaderContent. |
IsContentOverflowWindowShowing | Gets or sets whether the overflow drop-down, holding the commands that did not fit, is open. |
IsOpen | Gets or sets whether the toolbar's drop-down menu is open. |
ItemsTemplate | Gets or sets a template for the part of the drop-down menu that holds the menu items. |
ToolBarPlacementLocation | Gets or sets whether the toolbar is drawn for its place above the tabs or below the ribbon. |
| Methods | |
GetQuickAccessChildPlacement | Gets where an item of the toolbar is meant to appear: on the bar, in the menu, or both. |
MeasureOverride | Puts the ribbon commands on the bar, drawn small, and the other items in the menu; commands that do
not fit the width are moved to the template's PART_OverflowItemsHost panel, when it has one. |
OnApplyTemplate | Takes the template's panels for the bar, the overflow and the menu. |
OnItemsChanged | Lays the toolbar out again when an item is added or removed, so that the change shows at once. |
SetQuickAccessChildPlacement | Sets where an item of the toolbar is meant to appear: on the bar, in the menu, or both. |
| Fields | |
FooterContentProperty | Identifies the FooterContent dependency property. |
FooterDataTemplateProperty | Identifies the FooterDataTemplate dependency property. |
HasContentOverflowItemsProperty | Identifies the HasContentOverflowItems dependency property. |
HasItemsProperty | Identifies the HasItems dependency property. |
HeaderContentProperty | Identifies the HeaderContent dependency property. |
HeaderDataTemplateProperty | Identifies the HeaderDataTemplate dependency property. |
IsContentOverflowWindowShowingProperty | Identifies the IsContentOverflowWindowShowing dependency property. |
IsOpenProperty | Identifies the IsOpen dependency property. |
ItemsTemplateProperty | Identifies the ItemsTemplate dependency property. |
QuickAccessChildPlacementProperty | Identifies the QuickAccessChildPlacement attached property. |
ToolBarPlacementLocationProperty | Identifies the ToolBarPlacementLocation dependency property. |
Constructors
BinaryRibbonQuickAccessToolBar
Creates an empty quick access toolbar. A click on any of its commands or menu items closes its drop-downs.
Properties
HasContentOverflowItems
Gets or sets whether some commands did not fit and were moved to the overflow drop-down.
- Value
- Set by the toolbar each time it is measured. The default is
false.
Remarks
While it is true the template shows the overflow button, and the menu items move into
the overflow drop-down with the commands.
HasItems
Gets or sets whether the toolbar has menu items – items other than ribbon commands – to show in its drop-down menu.
- Value
- Set by the toolbar each time it lays its items out. The default is
false.
Remarks
The drop-down arrow is shown only while this is true. It hides
HasItems, which counts every item.
HeaderContent
Gets or sets what is shown at the top of the toolbar's drop-down menu, above its menu items.
- Value
- The default is
null; with the built-inHeaderDataTemplatethe menu is headed "Customize the QAT".
HeaderDataTemplate
Gets or sets the template that draws HeaderContent.
- Value
- The built-in style supplies one that draws a bold "Customize the QAT" heading; set
nullto drawHeaderContentas it is.
IsContentOverflowWindowShowing
Gets or sets whether the overflow drop-down, holding the commands that did not fit, is open.
- Value
- The default is
false. Binds two-way by default.
Remarks
Any change closes the menu drop-down (IsOpen).
IsOpen
Gets or sets whether the toolbar's drop-down menu is open.
- Value
- The default is
false. Binds two-way by default.
ItemsTemplate
Gets or sets a template for the part of the drop-down menu that holds the menu items.
- Value
- The default is
null.
ToolBarPlacementLocation
Gets or sets whether the toolbar is drawn for its place above the tabs or below the ribbon.
- Value
- The default is
QuickAccessToolbarPlacementLocation.Top.
Remarks
Chooses the toolbar's template. The ribbon sets it when its own
BinaryRibbonBarPanel.ToolbarPlacementLocation changes, which is what moves the toolbar;
set that rather than this.
Methods
GetQuickAccessChildPlacement static
Gets where an item of the toolbar is meant to appear: on the bar, in the menu, or both.
Parameters
obj- The item.
Returns
The placement; QuickAccessToolbarChildPlacementTarget.ToolBar unless set.
Remarks
The built-in toolbar does not read it: an item's place follows from its type, as the class remarks describe.
MeasureOverride
Puts the ribbon commands on the bar, drawn small, and the other items in the menu; commands that do
not fit the width are moved to the template's PART_OverflowItemsHost panel, when it has one.
Parameters
constraint- The space available.
Returns
The space the toolbar needs.
OnApplyTemplate
Takes the template's panels for the bar, the overflow and the menu.
Exceptions
System.ArgumentException- The template has no panel named
PART_ToolBarPanel.
OnItemsChanged
Lays the toolbar out again when an item is added or removed, so that the change shows at once.
Parameters
e- What changed.
SetQuickAccessChildPlacement static
Sets where an item of the toolbar is meant to appear: on the bar, in the menu, or both.
Parameters
obj- The item.
value- The placement.
Remarks
The built-in toolbar does not read it.
Fields
HasContentOverflowItemsProperty static
Identifies the HasContentOverflowItems dependency property.
HasItemsProperty static
Identifies the HasItems dependency property.
HeaderContentProperty static
Identifies the HeaderContent dependency property.
HeaderDataTemplateProperty static
Identifies the HeaderDataTemplate dependency property.
IsContentOverflowWindowShowingProperty static
Identifies the IsContentOverflowWindowShowing dependency property.
IsOpenProperty static
Identifies the IsOpen dependency property.
ItemsTemplateProperty static
Identifies the ItemsTemplate dependency property.
QuickAccessChildPlacementProperty static
Identifies the QuickAccessChildPlacement attached property.
ToolBarPlacementLocationProperty static
Identifies the ToolBarPlacementLocation dependency property.