In This Article

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:

true if the menu gallery can render surrounding separators; otherwise, false. The default value is true.

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:

true if the gallery sorts and displays items by category when an System.ComponentModel.ICollectionView is set to the ItemsSource; otherwise, false. The default value is true.

CanFilter

Indicates whether the gallery supports filtering of items by category.

public bool CanFilter { get; set; }

Property Value

bool:

true if the gallery supports filtering of items by category; otherwise, false. The default value is false.

CategoryContainerStyle

The Style that targets GroupItem, used to represent categories.

public Style? CategoryContainerStyle { get; set; }

Property Value

Style

CategoryHeaderTemplate

The DataTemplate to display the category header.

public DataTemplate? CategoryHeaderTemplate { get; set; }

Property Value

DataTemplate

HasCategoryHeaders

Indicates whether the gallery has category headers when categorizing.

public bool HasCategoryHeaders { get; set; }

Property Value

bool:

true if the gallery has category headers when categorizing; otherwise, false. The default value is true.

IsFilterButtonVisible

Indicates whether the filter button is visible.

public bool IsFilterButtonVisible { get; }

Property Value

bool:

true if the filter button is visible; otherwise, false.

MaxColumnCount

The maximum number of columns.

public int MaxColumnCount { get; set; }

Property Value

int:

The default value is MaxValue.

MinColumnCount

The minimum number of columns.

public int MinColumnCount { get; set; }

Property Value

int:

The default value is 1.

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.

public ICommand SelectFilterCategoryCommand { get; }

Property Value

ICommand

SelectedFilterCategory

The selected filter category name.

[Localizability(LocalizationCategory.Title)]
public string? SelectedFilterCategory { get; set; }

Property Value

string

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:

true if gallery items should use a menu item appearance; otherwise, false. The default value is false.

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:

true if gallery items should be indented past the menu's icon column; otherwise, false. The default value is false.

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

Extension Methods