In This Article

RibbonGallery Class

Represents a gallery control, for use within a Ribbon.

[TemplatePart(Name = "PART_CollapsedButton", Type = typeof(BarPopupButton))]
[TemplatePart(Name = "PART_ExpandedElement", Type = typeof(FrameworkElement))]
[TemplatePart(Name = "PART_MoreButton", Type = typeof(RibbonGalleryMoreButton))]
public class RibbonGallery : BarMenuGalleryHostBase, IOrientedElement
Inheritance:
object Visual UIElement FrameworkElement Control ItemsControl Selector BarGalleryBase BarMenuGalleryHostBase object
Implements:
IOrientedElement

Constructors

RibbonGallery()

Initializes a new instance of the RibbonGallery class.

public RibbonGallery()

Properties

CanAutoScrollToSelectedItem

Gets or sets whether to automatically scroll to the selected item on selection changes.

public bool CanAutoScrollToSelectedItem { get; set; }

Property Value

bool:

true if the selected item should automatically be scrolled into view on selection changes; otherwise, false. The default value is false.

CollapsedButtonToolTip

Gets or sets the tooltip for the collapsed button.

public object CollapsedButtonToolTip { get; set; }

Property Value

object:

The tooltip for the collapsed button.

IsScrolling

Gets whether the gallery is currently being scrolled.

public bool IsScrolling { get; }

Property Value

bool:

true if the gallery is currently being scrolled; otherwise, false.

KeyTipText

Gets or sets the key tip text used to access the control.

[Localizability(LocalizationCategory.Label)]
public string KeyTipText { get; set; }

Property Value

string:

The key tip text used to access the control.

LayoutMode

Gets or sets a RibbonLayoutMode indicating the layout mode in use.

public RibbonLayoutMode LayoutMode { get; set; }

Property Value

RibbonLayoutMode:

A RibbonLayoutMode indicating the layout mode in use.

MaxColumnCount

Gets or sets the maximum number of columns when in-ribbon.

public int MaxColumnCount { get; set; }

Property Value

int:

The maximum number of columns when in-ribbon. The default value is 15.

MaxItemsPresenterHeight

Gets or sets the maximum height of the in-ribbon items presenter.

public double MaxItemsPresenterHeight { get; set; }

Property Value

double:

The maximum height of the in-ribbon items presenter.

MinLargeColumnCount

Gets or sets the minimum number of columns to use when in-ribbon with a Large variant size.

public int MinLargeColumnCount { get; set; }

Property Value

int:

The minimum number of columns to use when in-ribbon with a Large variant size. The default value is 5.

MinMediumColumnCount

Gets or sets the minimum number of columns to use when in-ribbon with a Medium variant size.

public int MinMediumColumnCount { get; set; }

Property Value

int:

The minimum number of columns to use when in-ribbon with a Medium variant size. The default value is 3.

ScrollDownCommand

Gets the ICommand used to invoke the ScrollDown() method.

public ICommand ScrollDownCommand { get; }

Property Value

ICommand:

The ICommand used to invoke the ScrollDown() method.

ScrollUpCommand

Gets the ICommand used to invoke the ScrollUp() method.

public ICommand ScrollUpCommand { get; }

Property Value

ICommand:

The ICommand used to invoke the ScrollUp() method.

ToolBarItemCollapseBehavior

Gets or sets the ItemCollapseBehavior for the control when in a ribbon using Simplified layout mode.

public ItemCollapseBehavior ToolBarItemCollapseBehavior { get; set; }

Property Value

ItemCollapseBehavior:

The ItemCollapseBehavior for the control when in a ribbon using Simplified layout mode. The default value is Default.

ToolBarItemVariantBehavior

Gets or sets the ItemVariantBehavior for the control when in a toolbar, which also applies when in a ribbon using Simplified layout mode.

public ItemVariantBehavior ToolBarItemVariantBehavior { get; set; }

Property Value

ItemVariantBehavior:

The ItemVariantBehavior for the control when in a toolbar, which also applies when in a ribbon using Simplified layout mode. The default value is AlwaysSmall.

VariantSize

Gets or sets the VariantSize currently assigned to the control. This property should only be manually set when the control is standalone, and not hosted by a bar control.

public VariantSize VariantSize { get; set; }

Property Value

VariantSize:

The VariantSize currently assigned to the control.

Methods

ArrangeOverride(Size)

Called to arrange and size the content of a Control object.

protected override Size ArrangeOverride(Size arrangeBounds)
Parameter Type Description
arrangeBounds Size

The computed size that is used to arrange the content.

Returns

Size:

The size of the control.

OnApplyTemplate()

When overridden in a derived class, is invoked whenever application code or internal processes call ApplyTemplate().

public override void OnApplyTemplate()

OnCreateAutomationPeer()

Returns class-specific AutomationPeer implementations for the Windows Presentation Foundation (WPF) infrastructure.

protected override AutomationPeer OnCreateAutomationPeer()

Returns

AutomationPeer:

The type-specific AutomationPeer implementation.

OnItemSpacingPropertyValueChanged(DependencyPropertyChangedEventArgs)

Occurs when the ItemSpacing property value changes.

protected override void OnItemSpacingPropertyValueChanged(DependencyPropertyChangedEventArgs e)
Parameter Type Description
e DependencyPropertyChangedEventArgs

The System.Windows.DependencyPropertyChangedEventArgs containing data related to this event.

OnItemsChanged(NotifyCollectionChangedEventArgs)

Updates the current selection when an item in the Selector has changed.

protected override void OnItemsChanged(NotifyCollectionChangedEventArgs e)
Parameter Type Description
e NotifyCollectionChangedEventArgs

The event data.

OnMinItemHeightPropertyValueChanged(DependencyPropertyChangedEventArgs)

Occurs when the MinItemHeight property value changes.

protected override void OnMinItemHeightPropertyValueChanged(DependencyPropertyChangedEventArgs e)
Parameter Type Description
e DependencyPropertyChangedEventArgs

The System.Windows.DependencyPropertyChangedEventArgs containing data related to this event.

OnMinItemWidthPropertyValueChanged(DependencyPropertyChangedEventArgs)

Occurs when the MinItemWidth property value changes.

protected override void OnMinItemWidthPropertyValueChanged(DependencyPropertyChangedEventArgs e)
Parameter Type Description
e DependencyPropertyChangedEventArgs

The System.Windows.DependencyPropertyChangedEventArgs containing data related to this event.

OnSelectionChanged(SelectionChangedEventArgs)

Called when the selection changes.

protected override void OnSelectionChanged(SelectionChangedEventArgs e)
Parameter Type Description
e SelectionChangedEventArgs

The event data.

OnUserInterfaceDensityPropertyValueChanged(DependencyPropertyChangedEventArgs)

Occurs when the UserInterfaceDensity property value changes.

protected override void OnUserInterfaceDensityPropertyValueChanged(DependencyPropertyChangedEventArgs e)
Parameter Type Description
e DependencyPropertyChangedEventArgs

The System.Windows.DependencyPropertyChangedEventArgs containing data related to this event.

ScrollDown()

Scrolls the gallery down a row.

public void ScrollDown()

ScrollUp()

Scrolls the gallery up a row.

public void ScrollUp()

Fields

CanAutoScrollToSelectedItemProperty

Identifies the CanAutoScrollToSelectedItem dependency property. This field is read-only.

public static readonly DependencyProperty CanAutoScrollToSelectedItemProperty

CollapsedButtonToolTipProperty

Identifies the CollapsedButtonToolTip dependency property. This field is read-only.

public static readonly DependencyProperty CollapsedButtonToolTipProperty

IsScrollingProperty

Identifies the IsScrolling dependency property. This field is read-only.

public static readonly DependencyProperty IsScrollingProperty

KeyTipTextProperty

Identifies the KeyTipText dependency property. This field is read-only.

public static readonly DependencyProperty KeyTipTextProperty

LayoutModeProperty

Identifies the LayoutMode dependency property. This field is read-only.

public static readonly DependencyProperty LayoutModeProperty

MaxColumnCountProperty

Identifies the MaxColumnCount dependency property. This field is read-only.

public static readonly DependencyProperty MaxColumnCountProperty

MaxItemsPresenterHeightProperty

Identifies the MaxItemsPresenterHeight dependency property. This field is read-only.

public static readonly DependencyProperty MaxItemsPresenterHeightProperty

MinLargeColumnCountProperty

Identifies the MinLargeColumnCount dependency property. This field is read-only.

public static readonly DependencyProperty MinLargeColumnCountProperty

MinMediumColumnCountProperty

Identifies the MinMediumColumnCount dependency property. This field is read-only.

public static readonly DependencyProperty MinMediumColumnCountProperty

ToolBarItemCollapseBehaviorProperty

Identifies the ToolBarItemCollapseBehavior dependency property. This field is read-only.

public static readonly DependencyProperty ToolBarItemCollapseBehaviorProperty

ToolBarItemVariantBehaviorProperty

Identifies the ToolBarItemVariantBehavior dependency property. This field is read-only.

public static readonly DependencyProperty ToolBarItemVariantBehaviorProperty

VariantSizeProperty

Identifies the VariantSize dependency property. This field is read-only.

public static readonly DependencyProperty VariantSizeProperty

Inherited Members