HypernovaDesktop Components · docs
Binarymission
WPF › Ribbon › BinaryRibbonGallery

BinaryRibbonGallery

class.NET 6 / 8 / 10.NET Framework 4.8Binarymission.WPF.Controls.Office

A ribbon gallery: a strip of picture choices shown right on the ribbon, a row or two at a time, that opens into a full drop-down of every choice – Office's Styles, Table Styles and Themes galleries.

public partial class BinaryRibbonGallery : Selector, IBinaryRibbonComponent, IBinaryRibbonComponentAlwaysRenderLarge, IBinaryRibbonComponentActAsGallery, IBinaryRibbonKeyTipControl

Inherits from / implements: Selector, IBinaryRibbonComponent, IBinaryRibbonComponentAlwaysRenderLarge, IBinaryRibbonComponentActAsGallery, IBinaryRibbonKeyTipControl

Remarks

Use it where the choices are best judged by eye: page colours, chart styles, letterheads, label layouts. It is a Selector, so Selector.SelectedItem, Selector.SelectedIndex and Selector.SelectionChanged work as usual.

Choices

Add a BinaryRibbonThumbnailControl to ItemsControl.Items for each choice, with its picture in BinaryRibbonThumbnailControl.ImageSource; the selected item is then that thumbnail, and its FrameworkElement.Tag is a convenient place for the value it stands for. A click on a thumbnail selects it, which closes the drop-down and any ribbon pop-up the gallery is in.

On the ribbon and in the drop-down

On the ribbon the thumbnails are laid out Columns wide, each ThumbnailSize wide and one, two or three to the ribbon's height depending on how tall ThumbnailSize is, with buttons beside them to scroll a row up or down and a third to open the drop-down. The drop-down shows every thumbnail, with HeaderContent above and FooterContent below.

Inside a BinaryRibbonGroup, the group sets Columns itself as the window narrows: to the numbers in the attached RenderableGalleryColumnsProperty, one per step ("6,4,0" is six columns, then four, then none), or otherwise to 7, 5 and 3 in the usual three steps. At none the gallery collapses (IsCollapsed) to a single large button showing LargeImage and TitleText, which opens the drop-down. In the simplified ribbon layout a gallery is always collapsed to its button.

Live preview

As the pointer rests on a thumbnail the gallery raises BinaryRibbonLivePreview.PreviewRequestedEvent, and when it leaves without choosing, BinaryRibbonLivePreview.PreviewCancelledEvent; a choice raises BinaryRibbonLivePreview.PreviewCommittedEvent. Handle them to show the effect in the document before the user commits, as Office does. IsLivePreviewEnabled turns them off.

Examples

A page colour gallery that previews each colour on the document as the pointer rests on it. The window keeps the colour in force before the preview so that it can put it back.

<ribbon:BinaryRibbonGroup TitleText="Page"
        xmlns:ribbon="clr-namespace:Binarymission.WPF.Controls.Office;assembly=Binarymission.WPF.Controls.BinaryRibbon">
    <ribbon:BinaryRibbonGallery x:Name="paperGallery"
                                TitleText="Page colour"
                                LargeImage="Images/PageColour32.png"
                                ThumbnailSize="48,48"
                                ribbon:BinaryRibbonGallery.RenderableGalleryColumns="6,4,0"
                                ribbon:BinaryRibbonGallery.Stretch="Uniform">
        <ribbon:BinaryRibbonGallery.HeaderContent>
            <TextBlock Text="Paper" Margin="6,4" FontWeight="SemiBold" />
        </ribbon:BinaryRibbonGallery.HeaderContent>
        <ribbon:BinaryRibbonThumbnailControl ImageSource="Images/Paper/White.png" Tag="#FFFFFF" ToolTip="White" />
        <ribbon:BinaryRibbonThumbnailControl ImageSource="Images/Paper/Ivory.png" Tag="#FFFFF0" ToolTip="Ivory" />
        <ribbon:BinaryRibbonThumbnailControl ImageSource="Images/Paper/Mint.png"  Tag="#F0FFF4" ToolTip="Mint" />
        <ribbon:BinaryRibbonThumbnailControl ImageSource="Images/Paper/Sky.png"   Tag="#EEF6FF" ToolTip="Sky" />
    </ribbon:BinaryRibbonGallery>
</ribbon:BinaryRibbonGroup>
private Brush paperBeforePreview;

public MainWindow()
{
    InitializeComponent();

    // The events bubble, so handlers on the window would hear every gallery;
    // these listen to the paper gallery alone.
    BinaryRibbonLivePreview.AddPreviewRequestedHandler(paperGallery, (sender, e) =>
    {
        if (paperBeforePreview == null) paperBeforePreview = documentPage.Background;
        documentPage.Background = PaperFor(e.Item);
    });
    BinaryRibbonLivePreview.AddPreviewCancelledHandler(paperGallery, (sender, e) =>
    {
        if (paperBeforePreview != null) documentPage.Background = paperBeforePreview;
        paperBeforePreview = null;
    });
    BinaryRibbonLivePreview.AddPreviewCommittedHandler(paperGallery, (sender, e) =>
    {
        documentPage.Background = PaperFor(e.Item);
        paperBeforePreview = null;
    });
}

private static Brush PaperFor(object item)
{
    var thumbnail = (BinaryRibbonThumbnailControl)item;
    return (Brush)new BrushConverter().ConvertFromString((string)thumbnail.Tag);
}

See also

Members at a glance

Constructors
BinaryRibbonGalleryCreates a gallery with no thumbnails.
Properties
ActualColumnsGets how many whole columns of thumbnails the ribbon view is showing now.
BinaryRibbonTagGets or sets any object of your own to keep with the gallery.
ColumnsGets or sets how many columns of thumbnails the gallery shows on the ribbon.
DropDownColumnsGets or sets how many columns of thumbnails the drop-down should show.
DropDownMaximumSizeGets or sets the largest the area of thumbnails in the drop-down may grow.
DropDownWidthGets or sets a width for the drop-down.
FooterContentGets or sets content shown at the foot of the drop-down, under the thumbnails – "More colours...", "Save current style...".
FooterDataTemplateGets or sets the template that draws FooterContent when it is a data object rather than a UI element.
HeaderContentGets or sets content shown at the top of the drop-down, above the thumbnails – a heading such as "Built-in", or a filter.
HeaderDataTemplateGets or sets the template that draws HeaderContent when it is a data object rather than a UI element.
IsCollapsedGets or sets whether the gallery is shown as a single button that opens its drop-down, instead of as thumbnails on the ribbon.
IsDropDownOpenGets or sets whether the drop-down of every thumbnail is open.
IsLivePreviewEnabledGets or sets whether the gallery raises the live preview events as the pointer moves over its thumbnails.
IsVirtualizingGets or sets whether the gallery should create its thumbnails only as they come into view.
LargeImageGets or sets the picture on the button the gallery becomes when it is collapsed.
MouseOverItemGets the item the pointer is resting on, or null when it is on none.
MouseOverThumbnailGets the thumbnail the pointer is resting on, or null when it is on none.
ScrollAnimationDurationGets or sets how long the scroll by one row takes when the up and down buttons are used.
ScrollViewerGets the scroll viewer that holds the thumbnails shown on the ribbon.
ThumbnailSizeGets or sets the size of each thumbnail cell, which decides how many columns fit and how many rows the ribbon shows.
ThumbnailsGets or sets an object to keep with the gallery's thumbnails.
TitleTextGets or sets the caption on the button the gallery becomes when it is collapsed – "Styles", "Page colour".
VerticalScrollOffsetGets or sets how far the thumbnails on the ribbon are scrolled down.
Methods
DropDownOpenChangedCalled when IsDropDownOpen changes. Does nothing here; override it to react to the drop-down opening or closing.
GetContainerForItemOverrideCreates the container for an item that is not a thumbnail: a new BinaryRibbonThumbnailControl.
GetRenderableGalleryColumnsGets the column counts a gallery takes at each step of the ribbon's shrinking.
GetStretchGets how the pictures of a gallery's thumbnails fill their cells.
IsItemItsOwnContainerOverrideReports whether an item is shown as it stands: true for a BinaryRibbonThumbnailControl.
MeasureOverrideMeasures the gallery with the thumbnails on the ribbon limited to Columns columns, trimmed to a whole number of thumbnails.
OnApplyTemplateFinds the parts of the new template and lays the thumbnails out on the ribbon.
OnColumnsChangedCalled when Columns changes; lays the gallery out again at once.
OnItemsChangedRebuilds the thumbnails shown on the ribbon after the base handling of a change to the items.
OnMouseLeaveCancels any live preview when the pointer leaves the gallery, after the base handling of the event.
OnMouseOverThumbnailPropertyChangedCallbackCalled when MouseOverThumbnail changes; updates MouseOverItem, raises MouseOverThumbnailChanged and asks for or cancels a live preview.
OnPopupOpenCalled when the drop-down opens; places it over the gallery, or under the button when the gallery is collapsed, and sizes it to the gallery's columns.
OnPreviewKeyDownCancels any live preview when Escape is pressed, after the base handling of the key.
OnSelectionChangedCloses the drop-down, raises BinaryRibbonLivePreview.PreviewCommittedEvent for the new selection and scrolls it into view on the ribbon, after the base handling of the change.
PrepareContainerForItemOverridePrepares a thumbnail to show its item, sizing it to ThumbnailSize and the ribbon's rows and giving it the gallery's StretchProperty.
ScrollDownScrolls the thumbnails on the ribbon down by one row, with a short animation.
ScrollUpScrolls the thumbnails on the ribbon up by one row, with a short animation.
SetRenderableGalleryColumnsSets the column counts a gallery takes at each step of the ribbon's shrinking.
SetStretchSets how the pictures of a gallery's thumbnails fill their cells.
Events
MouseOverThumbnailChangedOccurs when the pointer moves onto a thumbnail or off one.
Fields
ColumnsPropertyIdentifies the Columns dependency property.
DropDownColumnsPropertyIdentifies the DropDownColumns dependency property.
DropDownMaximumSizePropertyIdentifies the DropDownMaximumSize dependency property.
DropDownWidthPropertyIdentifies the DropDownWidth dependency property.
FooterContentPropertyIdentifies the FooterContent dependency property.
FooterDataTemplatePropertyIdentifies the FooterDataTemplate dependency property.
HeaderContentPropertyIdentifies the HeaderContent dependency property.
HeaderDataTemplatePropertyIdentifies the HeaderDataTemplate dependency property.
IsCollapsedPropertyIdentifies the IsCollapsed dependency property.
IsDropDownOpenPropertyIdentifies the IsDropDownOpen dependency property.
IsLivePreviewEnabledPropertyIdentifies the IsLivePreviewEnabled dependency property.
IsVirtualizingPropertyIdentifies the IsVirtualizing dependency property.
LargeImagePropertyIdentifies the LargeImage dependency property.
MouseOverItemPropertyIdentifies the MouseOverItem dependency property.
MouseOverThumbnailChangedEventIdentifies the MouseOverThumbnailChanged routed event.
MouseOverThumbnailPropertyIdentifies the MouseOverThumbnail dependency property.
RenderableGalleryColumnsPropertyIdentifies the RenderableGalleryColumns attached property: how many columns a gallery shows at each step as its BinaryRibbonGroup gives up width.
ScrollAnimationDurationPropertyIdentifies the ScrollAnimationDuration dependency property.
ScrollDownCommandThe command that scrolls the thumbnails on the ribbon down one row, as the gallery's down button does.
ScrollUpCommandThe command that scrolls the thumbnails on the ribbon up one row, as the gallery's up button does.
StretchPropertyIdentifies the Stretch attached property: how the picture in each thumbnail fills its cell.
ThumbnailSizePropertyIdentifies the ThumbnailSize dependency property.
ThumbnailsPropertyIdentifies the Thumbnails dependency property.
TitleTextPropertyIdentifies the TitleText dependency property.
VerticalScrollOffsetPropertyIdentifies the VerticalScrollOffset dependency property.

Constructors

BinaryRibbonGallery

public BinaryRibbonGallery() : base()

Creates a gallery with no thumbnails.

Remarks

Add BinaryRibbonThumbnailControl items to ItemsControl.Items, then put the gallery in a BinaryRibbonGroup.

Properties

ActualColumns

public int ActualColumns

Gets how many whole columns of thumbnails the ribbon view is showing now.

Value
The width the thumbnails take on the ribbon divided by the width of one thumbnail, rounded down.
Remarks

The drop-down opens this many thumbnails wide. Read it only once the gallery has been laid out; before its template is applied it throws a NullReferenceException.

See also

BinaryRibbonTag

public object BinaryRibbonTag

Gets or sets any object of your own to keep with the gallery.

Value
Any object. The default is null.
Remarks

The ribbon never reads it. It is a plain property, not a dependency property, so it cannot be the target of a binding or a style setter; use FrameworkElement.Tag for that.

Columns

public int Columns

Gets or sets how many columns of thumbnails the gallery shows on the ribbon.

Value
The number of columns. The default is 3.
Remarks

Inside a BinaryRibbonGroup the group sets this as the window widens and narrows, from RenderableGalleryColumnsProperty when it is set, and replaces any value given here. Use that attached property to control the column count of a gallery in a group.

See also

DropDownColumns

public int DropDownColumns

Gets or sets how many columns of thumbnails the drop-down should show.

Value
The number of columns, or 0 for the default. The default is 0.
Remarks

The value is stored but has no effect on the drop-down, which is as wide as ActualColumns thumbnails when it opens.

DropDownMaximumSize

public Size DropDownMaximumSize

Gets or sets the largest the area of thumbnails in the drop-down may grow.

Value
The width and height in device-independent units (1/96 inch). The default is unlimited in both directions.
Remarks

It limits the thumbnails, not the header and footer content. It is applied each time the drop-down opens.

DropDownWidth

public double DropDownWidth

Gets or sets a width for the drop-down.

Value
The width in device-independent units (1/96 inch). The default is NaN.
Remarks

The gallery's template does not use this value; the drop-down is sized to ActualColumns thumbnails when it opens, within DropDownMaximumSize.

FooterContent

public object FooterContent

Gets or sets content shown at the foot of the drop-down, under the thumbnails – "More colours...", "Save current style...".

Value
Any content: a UI element, or an object drawn by FooterDataTemplate. The default is null, which shows nothing.
See also

FooterDataTemplate

public DataTemplate FooterDataTemplate

Gets or sets the template that draws FooterContent when it is a data object rather than a UI element.

Value
The template. The default is null, which shows a data object as its text.

HeaderContent

public object HeaderContent

Gets or sets content shown at the top of the drop-down, above the thumbnails – a heading such as "Built-in", or a filter.

Value
Any content: a UI element, or an object drawn by HeaderDataTemplate. The default is null, which shows nothing.
See also

HeaderDataTemplate

public DataTemplate HeaderDataTemplate

Gets or sets the template that draws HeaderContent when it is a data object rather than a UI element.

Value
The template. The default is null, which shows a data object as its text.

IsCollapsed

public bool IsCollapsed

Gets or sets whether the gallery is shown as a single button that opens its drop-down, instead of as thumbnails on the ribbon.

Value
true when collapsed. The default is false.
Remarks

Collapsed, the gallery is a large button showing LargeImage over TitleText, and its drop-down opens below it rather than over it.

Inside a BinaryRibbonGroup the group sets this whenever it resizes – collapsing the gallery at a step where it is given no columns – and replaces any value given here.

IsDropDownOpen

public bool IsDropDownOpen

Gets or sets whether the drop-down of every thumbnail is open.

Value
true while it is open. The default is false.
Remarks

Binds two-way by default. Setting it opens or closes the drop-down; choosing a thumbnail closes it and sets this back to false.

IsLivePreviewEnabled

public bool IsLivePreviewEnabled

Gets or sets whether the gallery raises the live preview events as the pointer moves over its thumbnails.

Value
true to raise BinaryRibbonLivePreview.PreviewRequestedEvent, BinaryRibbonLivePreview.PreviewCancelledEvent and BinaryRibbonLivePreview.PreviewCommittedEvent. The default is true.
Remarks

An unhandled event costs next to nothing, so there is no need to turn this off just because nothing listens. Turn it off for a gallery whose choices are slow to apply or cannot be undone, where showing each one in passing would do more harm than good.

IsVirtualizing

public bool IsVirtualizing

Gets or sets whether the gallery should create its thumbnails only as they come into view.

Value
The default is false.
Remarks

The gallery does not read this property: every thumbnail is created whatever its value.

LargeImage

public ImageSource LargeImage

Gets or sets the picture on the button the gallery becomes when it is collapsed.

Value
The picture, drawn 32 x 32 device-independent units. The default is null.
Remarks

Used when IsCollapsed is true; in the simplified ribbon layout it is drawn small, beside TitleText.

MouseOverItem

public object MouseOverItem

Gets the item the pointer is resting on, or null when it is on none.

Value
The item from ItemsControl.Items under the pointer – the BinaryRibbonThumbnailControl itself when the thumbnails were added directly. The default is null.
Remarks

It follows the pointer over the thumbnails on the ribbon and in the drop-down alike, and changes with MouseOverThumbnail. It is the item each live preview request carries.

See also

MouseOverThumbnail

public BinaryRibbonThumbnailControl MouseOverThumbnail

Gets the thumbnail the pointer is resting on, or null when it is on none.

Value
The thumbnail, as it is in ItemsControl.Items (or the container made for an item) – the same object whether the pointer is over its copy on the ribbon or over it in the drop-down. The default is null.
Remarks

Each change raises MouseOverThumbnailChanged.

See also

ScrollAnimationDuration

public double ScrollAnimationDuration

Gets or sets how long the scroll by one row takes when the up and down buttons are used.

Value
The duration in milliseconds. The default is 300.
Remarks

The scroll starts fast and slows to a stop. Set 0 for an instant jump.

ScrollViewer

protected virtual ScrollViewer ScrollViewer

Gets the scroll viewer that holds the thumbnails shown on the ribbon.

Value
The parent of the template's PART_WrapPanel when that is a ScrollViewer; otherwise null.
Remarks

Read it only once the template has been applied; before then it throws a NullReferenceException.

ThumbnailSize

public Size ThumbnailSize

Gets or sets the size of each thumbnail cell, which decides how many columns fit and how many rows the ribbon shows.

Value
The width and height in device-independent units (1/96 inch). The default is 48 x 48.
Remarks

The width is used as it is. The height chooses the number of rows on the ribbon, which then share the ribbon's height: 24 or less gives three rows, 48 or less two, anything taller one.

Set it before the thumbnails are added; it is applied to each thumbnail as it is laid out.

Example
<!-- Small swatches, three rows deep on the ribbon. -->
<ribbon:BinaryRibbonGallery ThumbnailSize="22,22" />

Thumbnails

public object Thumbnails

Gets or sets an object to keep with the gallery's thumbnails.

Value
Any object. The default is null.
Remarks

The gallery does not read this property; its thumbnails are its ItemsControl.Items.

TitleText

public string TitleText

Gets or sets the caption on the button the gallery becomes when it is collapsed – "Styles", "Page colour".

Value
The caption. The default is an empty string.
See also

VerticalScrollOffset

public double VerticalScrollOffset

Gets or sets how far the thumbnails on the ribbon are scrolled down.

Value
The offset from the top, in device-independent units (1/96 inch). The default is 0.
Remarks

Setting it scrolls the ribbon view to that offset. ScrollUp and ScrollDown animate it, and the animation holds it at its final value afterwards, so once either has run a value set here does not take effect.

Methods

DropDownOpenChanged

protected virtual void DropDownOpenChanged(DependencyPropertyChangedEventArgs e)

Called when IsDropDownOpen changes. Does nothing here; override it to react to the drop-down opening or closing.

Parameters
e
The old and new values.

GetContainerForItemOverride

protected override DependencyObject GetContainerForItemOverride()

Creates the container for an item that is not a thumbnail: a new BinaryRibbonThumbnailControl.

Returns

GetRenderableGalleryColumns static

public static BinaryRibbonGalleryControlColumns GetRenderableGalleryColumns(DependencyObject obj)

Gets the column counts a gallery takes at each step of the ribbon's shrinking.

Parameters
obj
The gallery.
Returns

The column counts, or null when none have been set.

See also

GetStretch static

public static Stretch GetStretch(DependencyObject obj)

Gets how the pictures of a gallery's thumbnails fill their cells.

Parameters
obj
The gallery or thumbnail to read it from.
Returns

The stretch; None unless it has been set.

See also

IsItemItsOwnContainerOverride

protected override bool IsItemItsOwnContainerOverride(object item)

Reports whether an item is shown as it stands: true for a BinaryRibbonThumbnailControl.

Parameters
item
The item.
Returns

true when item is a BinaryRibbonThumbnailControl; otherwise false, and one is made to hold it.

MeasureOverride

protected override Size MeasureOverride(Size constraint)

Measures the gallery with the thumbnails on the ribbon limited to Columns columns, trimmed to a whole number of thumbnails.

Parameters
constraint
The space available.
Returns

The size the gallery wants.

OnApplyTemplate

public override void OnApplyTemplate()

Finds the parts of the new template and lays the thumbnails out on the ribbon.

Exceptions
System.ArgumentNullException
The template has no Panel named PART_WrapPanel.
Remarks

The template must contain a Panel named PART_WrapPanel for the thumbnails on the ribbon, an element named PART_ItemsPresenter for the drop-down, and a BinaryRibbonDropDownButton named PART_PopupButton that opens it.

OnColumnsChanged

protected virtual void OnColumnsChanged(DependencyPropertyChangedEventArgs e)

Called when Columns changes; lays the gallery out again at once.

Parameters
e
The old and new column counts.

OnItemsChanged

protected override void OnItemsChanged(NotifyCollectionChangedEventArgs e)

Rebuilds the thumbnails shown on the ribbon after the base handling of a change to the items.

Parameters
e
What changed in the items.

OnMouseLeave

protected override void OnMouseLeave(MouseEventArgs e)

Cancels any live preview when the pointer leaves the gallery, after the base handling of the event.

Parameters
e
The data for the event.
Remarks

The thumbnail the pointer was last over does not always report the pointer leaving it, so the gallery as a whole makes sure the document is put back.

OnMouseOverThumbnailPropertyChangedCallback

protected virtual void OnMouseOverThumbnailPropertyChangedCallback(DependencyPropertyChangedEventArgs e)

Called when MouseOverThumbnail changes; updates MouseOverItem, raises MouseOverThumbnailChanged and asks for or cancels a live preview.

Parameters
e
The old and new thumbnail.
Remarks

Call the base method from an override, or the event and the live preview stop.

OnPopupOpen

protected virtual void OnPopupOpen(object sender, RoutedEventArgs e)

Called when the drop-down opens; places it over the gallery, or under the button when the gallery is collapsed, and sizes it to the gallery's columns.

Parameters
sender
The drop-down button that opened.
e
The data for the event.
Remarks

Call the base method from an override, or the drop-down opens in the wrong place.

OnPreviewKeyDown

protected override void OnPreviewKeyDown(KeyEventArgs e)

Cancels any live preview when Escape is pressed, after the base handling of the key.

Parameters
e
The data for the event.
Remarks

Escape is how a user backs out of a preview without choosing.

OnSelectionChanged

protected override void OnSelectionChanged(SelectionChangedEventArgs e)

Closes the drop-down, raises BinaryRibbonLivePreview.PreviewCommittedEvent for the new selection and scrolls it into view on the ribbon, after the base handling of the change.

Parameters
e
The items added to and removed from the selection.
Remarks

A selection made in code commits a live preview just as a click does.

PrepareContainerForItemOverride

protected override void PrepareContainerForItemOverride(DependencyObject element, object item)

Prepares a thumbnail to show its item, sizing it to ThumbnailSize and the ribbon's rows and giving it the gallery's StretchProperty.

Parameters
element
The thumbnail.
item
The item it shows.

ScrollDown

public void ScrollDown()

Scrolls the thumbnails on the ribbon down by one row, with a short animation.

Remarks

The scroll snaps to whole rows, and lasts ScrollAnimationDuration. Past the last row it does nothing visible.

Call it once the gallery has been loaded; before its template is applied it throws a NullReferenceException.

See also

ScrollUp

public void ScrollUp()

Scrolls the thumbnails on the ribbon up by one row, with a short animation.

Remarks

The scroll snaps to whole rows, and lasts ScrollAnimationDuration. At the first row it does nothing visible.

Call it once the gallery has been loaded; before its template is applied it throws a NullReferenceException.

See also

SetRenderableGalleryColumns static

public static void SetRenderableGalleryColumns(DependencyObject obj, BinaryRibbonGalleryControlColumns value)

Sets the column counts a gallery takes at each step of the ribbon's shrinking.

Parameters
obj
The gallery.
value
The column counts, widest first; 0 collapses the gallery to a button.
See also

SetStretch static

public static void SetStretch(DependencyObject obj, Stretch value)

Sets how the pictures of a gallery's thumbnails fill their cells.

Parameters
obj
The gallery, to set it for all its thumbnails.
value
The stretch.
See also

Events

MouseOverThumbnailChanged

public event RoutedEventHandler MouseOverThumbnailChanged

Occurs when the pointer moves onto a thumbnail or off one.

Remarks

A bubbling routed event. Read MouseOverThumbnail or MouseOverItem in the handler to see where the pointer is now; both are null when it has moved off. For showing the effect of a choice in the document, the live preview events of BinaryRibbonLivePreview are the better fit, because they also say when to put things back and when the choice is final.

Fields

ColumnsProperty static

public static readonly DependencyProperty ColumnsProperty

Identifies the Columns dependency property.

DropDownColumnsProperty static

public static readonly DependencyProperty DropDownColumnsProperty

Identifies the DropDownColumns dependency property.

DropDownMaximumSizeProperty static

public static readonly DependencyProperty DropDownMaximumSizeProperty

Identifies the DropDownMaximumSize dependency property.

DropDownWidthProperty static

public static readonly DependencyProperty DropDownWidthProperty

Identifies the DropDownWidth dependency property.

FooterContentProperty static

public static readonly DependencyProperty FooterContentProperty

Identifies the FooterContent dependency property.

FooterDataTemplateProperty static

public static readonly DependencyProperty FooterDataTemplateProperty

Identifies the FooterDataTemplate dependency property.

HeaderContentProperty static

public static readonly DependencyProperty HeaderContentProperty

Identifies the HeaderContent dependency property.

HeaderDataTemplateProperty static

public static readonly DependencyProperty HeaderDataTemplateProperty

Identifies the HeaderDataTemplate dependency property.

IsCollapsedProperty static

public static readonly DependencyProperty IsCollapsedProperty

Identifies the IsCollapsed dependency property.

IsDropDownOpenProperty static

public static readonly DependencyProperty IsDropDownOpenProperty

Identifies the IsDropDownOpen dependency property.

IsLivePreviewEnabledProperty static

public static readonly DependencyProperty IsLivePreviewEnabledProperty

Identifies the IsLivePreviewEnabled dependency property.

IsVirtualizingProperty static

public static readonly DependencyProperty IsVirtualizingProperty

Identifies the IsVirtualizing dependency property.

LargeImageProperty static

public static readonly DependencyProperty LargeImageProperty

Identifies the LargeImage dependency property.

MouseOverItemProperty static

public static readonly DependencyProperty MouseOverItemProperty

Identifies the MouseOverItem dependency property.

MouseOverThumbnailChangedEvent static

public static readonly RoutedEvent MouseOverThumbnailChangedEvent

Identifies the MouseOverThumbnailChanged routed event.

MouseOverThumbnailProperty static

public static readonly DependencyProperty MouseOverThumbnailProperty

Identifies the MouseOverThumbnail dependency property.

RenderableGalleryColumnsProperty static

public static readonly DependencyProperty RenderableGalleryColumnsProperty

Identifies the RenderableGalleryColumns attached property: how many columns a gallery shows at each step as its BinaryRibbonGroup gives up width.

Remarks

In XAML, write the counts as a comma-separated list, widest first: ribbon:BinaryRibbonGallery.RenderableGalleryColumns="6,4,0" shows six columns while there is room, four at the next step and, at the third, collapses the gallery to a button that opens the drop-down. Past the last number the last one is kept. Without it, the group uses 7, 5 and 3 in the usual three steps.

Setting it on a gallery also sets Columns to the first number straight away.

ScrollAnimationDurationProperty static

public static readonly DependencyProperty ScrollAnimationDurationProperty

Identifies the ScrollAnimationDuration dependency property.

ScrollDownCommand static

public static RoutedUICommand ScrollDownCommand

The command that scrolls the thumbnails on the ribbon down one row, as the gallery's down button does.

Remarks

Every gallery handles it by calling ScrollDown. A control outside the gallery that uses it must name the gallery as its command target.

ScrollUpCommand static

public static RoutedUICommand ScrollUpCommand

The command that scrolls the thumbnails on the ribbon up one row, as the gallery's up button does.

Remarks

Every gallery handles it by calling ScrollUp. A control outside the gallery that uses it must name the gallery as its command target.

StretchProperty static

public static readonly DependencyProperty StretchProperty

Identifies the Stretch attached property: how the picture in each thumbnail fills its cell.

Remarks

Set it on the gallery; the gallery copies it to each thumbnail as the thumbnail is laid out, and the thumbnail's picture is drawn with it. The default, None, draws each picture at its own size, centred in the cell; Uniform scales it to fit.

ThumbnailSizeProperty static

public static readonly DependencyProperty ThumbnailSizeProperty

Identifies the ThumbnailSize dependency property.

ThumbnailsProperty static

public static readonly DependencyProperty ThumbnailsProperty

Identifies the Thumbnails dependency property.

TitleTextProperty static

public static readonly DependencyProperty TitleTextProperty

Identifies the TitleText dependency property.

VerticalScrollOffsetProperty static

public static readonly DependencyProperty VerticalScrollOffsetProperty

Identifies the VerticalScrollOffset dependency property.