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 an instance of the class.
public RibbonGallery()
Properties
CanAutoScrollToSelectedItem
Indicates whether to automatically scroll to the selected item on selection changes.
public bool CanAutoScrollToSelectedItem { get; set; }
Property Value
- bool:
trueif the selected item should automatically be scrolled into view on selection changes; otherwise,false. The default value isfalse.
CollapsedButtonToolTip
The tooltip for the collapsed button.
IsScrolling
Indicates whether the gallery is currently being scrolled.
public bool IsScrolling { get; }
Property Value
- bool:
trueif the gallery is currently being scrolled; otherwise,false.
KeyTipText
The key tip text used to access the control.
[Localizability(LocalizationCategory.Label)]
public string? KeyTipText { get; set; }
Property Value
LayoutMode
A RibbonLayoutMode indicating the layout mode in use.
MaxColumnCount
The maximum number of columns when in-ribbon.
MaxItemsPresenterHeight
The maximum height of the in-ribbon items presenter.
MinLargeColumnCount
The minimum number of columns to use when in-ribbon with a Large variant size.
MinMediumColumnCount
The minimum number of columns to use when in-ribbon with a Medium variant size.
ScrollDownCommand
The ICommand used to invoke the ScrollDown() method.
ScrollUpCommand
The ICommand used to invoke the ScrollUp() method.
ToolBarItemCollapseBehavior
The ItemCollapseBehavior for the control when in a ribbon using Simplified layout mode.
public ItemCollapseBehavior ToolBarItemCollapseBehavior { get; set; }
Property Value
- ItemCollapseBehavior:
The default value is Default.
ToolBarItemVariantBehavior
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 default value is AlwaysSmall.
VariantSize
The VariantSize currently assigned to the control.
public VariantSize VariantSize { get; set; }
Property Value
Remarks
This property should only be manually set when the control is standalone, and not hosted by a bar 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 event data. |
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 event data. |
OnMinItemWidthPropertyValueChanged(DependencyPropertyChangedEventArgs)
Occurs when the MinItemWidth property value changes.
protected override void OnMinItemWidthPropertyValueChanged(DependencyPropertyChangedEventArgs e)
| Parameter | Type | Description |
|---|---|---|
| e | DependencyPropertyChangedEventArgs | The event data. |
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 event data. |
PrepareContainerForItemOverride(DependencyObject, object)
Prepares the specified element to display the specified item.
protected override void PrepareContainerForItemOverride(DependencyObject element, object item)
| Parameter | Type | Description |
|---|---|---|
| element | DependencyObject | The element that is used to display the specified item. |
| item | object | The specified item to display. |
ScrollDown()
Scrolls the gallery down a row.
public void ScrollDown()
ScrollUp()
Scrolls the gallery up a row.
public void ScrollUp()
Fields
CanAutoScrollToSelectedItemProperty
Defines the CanAutoScrollToSelectedItem property.
public static readonly DependencyProperty CanAutoScrollToSelectedItemProperty
CollapsedButtonToolTipProperty
Defines the CollapsedButtonToolTip property.
public static readonly DependencyProperty CollapsedButtonToolTipProperty
IsScrollingProperty
Defines the IsScrolling property.
public static readonly DependencyProperty IsScrollingProperty
KeyTipTextProperty
Defines the KeyTipText property.
public static readonly DependencyProperty KeyTipTextProperty
LayoutModeProperty
Defines the LayoutMode property.
public static readonly DependencyProperty LayoutModeProperty
MaxColumnCountProperty
Defines the MaxColumnCount property.
public static readonly DependencyProperty MaxColumnCountProperty
MaxItemsPresenterHeightProperty
Defines the MaxItemsPresenterHeight property.
public static readonly DependencyProperty MaxItemsPresenterHeightProperty
MinLargeColumnCountProperty
Defines the MinLargeColumnCount property.
public static readonly DependencyProperty MinLargeColumnCountProperty
MinMediumColumnCountProperty
Defines the MinMediumColumnCount property.
public static readonly DependencyProperty MinMediumColumnCountProperty
ToolBarItemCollapseBehaviorProperty
Defines the ToolBarItemCollapseBehavior property.
public static readonly DependencyProperty ToolBarItemCollapseBehaviorProperty
ToolBarItemVariantBehaviorProperty
Defines the ToolBarItemVariantBehavior property.
public static readonly DependencyProperty ToolBarItemVariantBehaviorProperty
VariantSizeProperty
Defines the VariantSize property.
public static readonly DependencyProperty VariantSizeProperty
Inherited Members
- BarMenuGalleryHostBase.AboveMenuItemsProperty
- BarMenuGalleryHostBase.AreSurroundingSeparatorsAllowedOnMenuProperty
- BarMenuGalleryHostBase.BelowMenuItemsProperty
- BarMenuGalleryHostBase.CanCategorizeOnMenuProperty
- BarMenuGalleryHostBase.CanFilterOnMenuProperty
- BarMenuGalleryHostBase.CategoryHeaderTemplateProperty
- BarMenuGalleryHostBase.HasCategoryHeadersOnMenuProperty
- BarMenuGalleryHostBase.InvocationFocusBehaviorProperty
- BarMenuGalleryHostBase.MaxMenuColumnCountProperty
- BarMenuGalleryHostBase.MaxMenuGalleryHeightProperty
- BarMenuGalleryHostBase.MenuResizeModeProperty
- BarMenuGalleryHostBase.MinMenuColumnCountProperty
- BarMenuGalleryHostBase.PopupClosedCommandProperty
- BarMenuGalleryHostBase.PopupOpeningCommandProperty
- BarMenuGalleryHostBase.SelectedFilterCategoryProperty
- BarMenuGalleryHostBase.UseMenuItemAppearanceProperty
- BarMenuGalleryHostBase.UseMenuItemIndentProperty
- BarMenuGalleryHostBase.AboveMenuItems
- BarMenuGalleryHostBase.AreSurroundingSeparatorsAllowedOnMenu
- BarMenuGalleryHostBase.BelowMenuItems
- BarMenuGalleryHostBase.CanCategorizeOnMenu
- BarMenuGalleryHostBase.CanFilterOnMenu
- BarMenuGalleryHostBase.CategoryHeaderTemplate
- BarMenuGalleryHostBase.HasCategoryHeadersOnMenu
- BarMenuGalleryHostBase.InvocationFocusBehavior
- BarMenuGalleryHostBase.MaxMenuColumnCount
- BarMenuGalleryHostBase.MaxMenuGalleryHeight
- BarMenuGalleryHostBase.MenuResizeMode
- BarMenuGalleryHostBase.MinMenuColumnCount
- BarMenuGalleryHostBase.PopupClosedCommand
- BarMenuGalleryHostBase.PopupOpeningCommand
- BarMenuGalleryHostBase.SelectedFilterCategory
- BarMenuGalleryHostBase.UseMenuItemAppearance
- BarMenuGalleryHostBase.UseMenuItemIndent
- BarGalleryBase.HighlightedItemChangedEvent
- BarGalleryBase.BetweenPreviewDelayProperty
- BarGalleryBase.CanCloneToRibbonQuickAccessToolBarProperty
- BarGalleryBase.CommandProperty
- BarGalleryBase.CommandTargetProperty
- BarGalleryBase.HighlightedItemProperty
- BarGalleryBase.InitialPreviewDelayProperty
- BarGalleryBase.IsSelectionSupportedProperty
- BarGalleryBase.ItemSpacingProperty
- BarGalleryBase.KeyProperty
- BarGalleryBase.LabelProperty
- BarGalleryBase.LargeImageSourceProperty
- BarGalleryBase.MinItemHeightProperty
- BarGalleryBase.MinItemWidthProperty
- BarGalleryBase.MediumImageSourceProperty
- BarGalleryBase.PreviewedItemProperty
- BarGalleryBase.SmallImageSourceProperty
- BarGalleryBase.StaysOpenOnClickProperty
- BarGalleryBase.TitleProperty
- BarGalleryBase.UseAccentedItemBorderProperty
- BarGalleryBase.UserInterfaceDensityProperty
- BarGalleryBase.ClearContainerForItemOverride(DependencyObject, object)
- BarGalleryBase.GetContainerForItemOverride()
- BarGalleryBase.IsItemItsOwnContainerOverride(object)
- BarGalleryBase.OnHighlightedItemChanged(RoutedEventArgs)
- BarGalleryBase.OnIsKeyboardFocusWithinChanged(DependencyPropertyChangedEventArgs)
- BarGalleryBase.OnMouseLeave(MouseEventArgs)
- BarGalleryBase.OnMouseMove(MouseEventArgs)
- BarGalleryBase.ScrollToSelectedItem(bool)
- BarGalleryBase.ToString()
- BarGalleryBase.BetweenPreviewDelay
- BarGalleryBase.CanCloneToRibbonQuickAccessToolBar
- BarGalleryBase.CanStopPreviewingOnMouseLeave
- BarGalleryBase.Command
- BarGalleryBase.CommandTarget
- BarGalleryBase.HighlightedItem
- BarGalleryBase.InitialPreviewDelay
- BarGalleryBase.IsSelectionSupported
- BarGalleryBase.ItemSpacing
- BarGalleryBase.Key
- BarGalleryBase.Label
- BarGalleryBase.LargeImageSource
- BarGalleryBase.MediumImageSource
- BarGalleryBase.MinItemHeight
- BarGalleryBase.MinItemWidth
- BarGalleryBase.PreviewedItem
- BarGalleryBase.SmallImageSource
- BarGalleryBase.StaysOpenOnClick
- BarGalleryBase.Title
- BarGalleryBase.UseAccentedItemBorder
- BarGalleryBase.UserInterfaceDensity
- BarGalleryBase.HighlightedItemChanged