BarMenuGallery Class
Represents a gallery control, for use within a menu.
[TemplatePart(Name = "PART_FilterButton", Type = typeof(BarMenuGalleryFilterButton))]
[TemplatePart(Name = "PART_ResizablePanel", Type = typeof(BarMenuGalleryResizablePanel))]
public class BarMenuGallery : BarGalleryBase, IDragResizableControl
- Inheritance:
- object Visual UIElement FrameworkElement Control ItemsControl Selector BarGalleryBase object
- Derived:
- BarSizeSelectionMenuGallery
- Implements:
- IDragResizableControl
Constructors
BarMenuGallery()
Initializes an instance of the class.
public BarMenuGallery()
Properties
AreSurroundingSeparatorsAllowed
Indicates whether the menu gallery can render surrounding separators.
public bool AreSurroundingSeparatorsAllowed { get; set; }
Property Value
- bool:
trueif the menu gallery can render surrounding separators; otherwise,false. The default value istrue.
CanCategorize
Indicates whether the gallery sorts and displays items by category when an System.ComponentModel.ICollectionView is set to the ItemsSource.
public bool CanCategorize { get; set; }
Property Value
- bool:
trueif the gallery sorts and displays items by category when an System.ComponentModel.ICollectionView is set to theItemsSource; otherwise,false. The default value istrue.
CanFilter
Indicates whether the gallery supports filtering of items by category.
public bool CanFilter { get; set; }
Property Value
- bool:
trueif the gallery supports filtering of items by category; otherwise,false. The default value isfalse.
CategoryContainerStyle
CategoryHeaderTemplate
The DataTemplate to display the category header.
HasCategoryHeaders
Indicates whether the gallery has category headers when categorizing.
public bool HasCategoryHeaders { get; set; }
Property Value
- bool:
trueif the gallery has category headers when categorizing; otherwise,false. The default value istrue.
IsFilterButtonVisible
Indicates whether the filter button is visible.
public bool IsFilterButtonVisible { get; }
Property Value
- bool:
trueif the filter button is visible; otherwise,false.
MaxColumnCount
The maximum number of columns.
MinColumnCount
The minimum number of columns.
ResizeMode
A ControlResizeMode that indicates how the menu that contains the gallery can resize.
public ControlResizeMode ResizeMode { get; set; }
Property Value
- ControlResizeMode:
The default value is None.
SelectFilterCategoryCommand
Provides an ICommand used to select the filter category specified in the command parameter.
SelectedFilterCategory
The selected filter category name.
[Localizability(LocalizationCategory.Title)]
public string? SelectedFilterCategory { get; set; }
Property Value
UseMenuItemAppearance
Indicates whether to use a menu item appearance for gallery items, common for single-column menu galleries.
public bool UseMenuItemAppearance { get; set; }
Property Value
- bool:
trueif gallery items should use a menu item appearance; otherwise,false. The default value isfalse.
UseMenuItemIndent
Indicates whether to align gallery items in a menu so that they indent past the menu's icon column.
public bool UseMenuItemIndent { get; set; }
Property Value
- bool:
trueif gallery items should be indented past the menu's icon column; otherwise,false. The default value isfalse.
Methods
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.
OnItemsSourceChanged(IEnumerable, IEnumerable)
Called when the source of an item in a selector changes.
protected override void OnItemsSourceChanged(IEnumerable oldValue, IEnumerable newValue)
| Parameter | Type | Description |
|---|---|---|
| oldValue | IEnumerable | Old value of the source. |
| newValue | IEnumerable | New value of the source. |
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. |
Fields
AreSurroundingSeparatorsAllowedProperty
Defines the AreSurroundingSeparatorsAllowed property.
public static readonly DependencyProperty AreSurroundingSeparatorsAllowedProperty
CanCategorizeProperty
Defines the CanCategorize property.
public static readonly DependencyProperty CanCategorizeProperty
CanFilterProperty
Defines the CanFilter property.
public static readonly DependencyProperty CanFilterProperty
CategoryContainerStyleProperty
Defines the CategoryContainerStyle property.
public static readonly DependencyProperty CategoryContainerStyleProperty
CategoryHeaderTemplateProperty
Defines the CategoryHeaderTemplate property.
public static readonly DependencyProperty CategoryHeaderTemplateProperty
HasCategoryHeadersProperty
Defines the HasCategoryHeaders property.
public static readonly DependencyProperty HasCategoryHeadersProperty
IsFilterButtonVisibleProperty
Defines the IsFilterButtonVisible property.
public static readonly DependencyProperty IsFilterButtonVisibleProperty
MaxColumnCountProperty
Defines the MaxColumnCount property.
public static readonly DependencyProperty MaxColumnCountProperty
MinColumnCountProperty
Defines the MinColumnCount property.
public static readonly DependencyProperty MinColumnCountProperty
ResizeModeProperty
Defines the ResizeMode property.
public static readonly DependencyProperty ResizeModeProperty
SelectedFilterCategoryProperty
Defines the SelectedFilterCategory property.
public static readonly DependencyProperty SelectedFilterCategoryProperty
UseMenuItemAppearanceProperty
Defines the UseMenuItemAppearance property.
public static readonly DependencyProperty UseMenuItemAppearanceProperty
UseMenuItemIndentProperty
Defines the UseMenuItemIndent property.
public static readonly DependencyProperty UseMenuItemIndentProperty
Inherited Members
- 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.OnItemSpacingPropertyValueChanged(DependencyPropertyChangedEventArgs)
- BarGalleryBase.OnMinItemHeightPropertyValueChanged(DependencyPropertyChangedEventArgs)
- BarGalleryBase.OnMinItemWidthPropertyValueChanged(DependencyPropertyChangedEventArgs)
- BarGalleryBase.OnMouseLeave(MouseEventArgs)
- BarGalleryBase.OnMouseMove(MouseEventArgs)
- BarGalleryBase.OnSelectionChanged(SelectionChangedEventArgs)
- BarGalleryBase.OnUserInterfaceDensityPropertyValueChanged(DependencyPropertyChangedEventArgs)
- 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