Galleries
Galleries are controls that allow for the visual presentation of items or choices.
The items act like buttons and are displayed in a scrollable list that animates when scrolled.
The items in the gallery could be any sort of object to which a visual representation can be applied.
For instance, you may wish to provide visual representations of styles that can be applied to a selection.
Or you may wish to use galleries for selecting many other things as well: underline styles, page orientation, margins, etc.
Essentially anything that can be selected via a visual representation of the result is a good candidate for the use of galleries.
Actipro Ribbon includes two gallery controls, one designed for use within the ribbon and one designed for use within popups.
In-Ribbon Galleries
Resizing Behavior
In-ribbon galleries mimic the Office gallery resizing behavior exactly.
In-ribbon galleries can be resized in three distinct stages, with each stage corresponding to the current variant size of the parent group.
Small Variant Size - The gallery is collapsed and renders like a popup button.
Clicking on the collapsed button displays a popup with the gallery items on it.
Collapsing behavior can be turned off.
An in-ribbon gallery in a group with a small variant
Medium Variant Size - When in this stage the gallery will display items.
It will show more or less item columns depending on the available space.
The range of display columns is configurable.
An in-ribbon gallery in a group with a medium variant
Large Variant Size - When in this stage the gallery will initially show the largest number of columns
from the medium variant size and can optionally grow to fill the remainder of the space on the ribbon with more columns.
The gallery automatically determines the item size and how wide each column is. You don't need to bother with specifying it yourself.
In-Ribbon Gallery Popup
Per the ribbon UI requirements, each in-ribbon gallery must have a popup that contains a popup gallery that
displays the same items as those found in the in-ribbon gallery.
Actipro Ribbon makes this easy to do and you can even bind the popup gallery's items source and item templates to the same ones used
for the parent in-ribbon gallery.
The popup can optionally be resizable, and by using Actipro Ribbon's advanced popups,
you can lay out any sort of control around the popup gallery.
For instance, add menu items above or below the popup gallery, or add an image header above the popup gallery.
Popups Galleries
Use on Any Control's Popup
Popup galleries aren't limited to being used on in-ribbon gallery popups.
In fact you can use them on any popup, such as those for popup buttons or split buttons.
A popup button with a popup gallery that shows color selection for a text highlight, with live preview
Initial Column Display
A property on the popup gallery is used to specify the initial number of columns that should
be displayed when the containing popup is displayed.
The gallery measures the size of the items for you and determines how wide to ensure the popup is so
that the number of columns of items you specify can be displayed.
Resizing the Containing Popup
Popup galleries can be placed on popups that allow resizing either both horizontally and vertically, vertically-only, or neither.
Categorizing Items
A category attached property can be assigned to each item.
If you choose to show categories in your popup gallery, the property values you specify will be used to group the items into categories.
The list style screenshot below shows categories being used.
A popup gallery showing list styles, and using the categorization and filtering features
Categorized Item Filtering
If you have categorization enabled in your popup gallery as described above, you can optionally add filtering capabilities.
The filter is a button at the top of the popup gallery that when clicked, shows a menu of available filters.
There is always an All option and then rest of the options are the various category names.
The All filter is used by default and does not perform any filtering.
When a specific category is chosen as a filter, only the items in that category are displayed.
Other Common Features
Render Using Templates or Via Custom Draw
You can choose to render each item using a standard WPF template or by drawing the item in code-behind.
This allows you maximum flexibility when designing the look of each item.
Live Preview
All galleries support live preview meaning that as the end user moves their mouse over an item, you can handle
events to update the target selection visually to see a preview of the result of clicking on the gallery item.
Showing bullet style changes for selected text is an excellent example of this.
Selection Tracking
Galleries can optionally track a selected gallery item and render its highlight so that the end user knows which one is selected.
Zooming-In on Mouse Over
Galleries support zooming-in on mouse over functionality.
This means that as the mouse moves over an item, a popup will appear over the item and it can display an alternate template for the item,
usually providing a bit more detail than the default one.
Item Screen Tips
Gallery items support all the screen tip functionality found on normal ribbon controls.