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 a new instance of the BarMenuGallery class.
public BarMenuGallery()
Properties
AreSurroundingSeparatorsAllowed
Gets or sets 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 istrue
.
CanCategorize
Gets or sets 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 theItemsSource
; otherwise,false
. The default value istrue
.
CanFilter
Gets or sets 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 isfalse
.
CategoryContainerStyle
public Style CategoryContainerStyle { get; set; }
Property Value
CategoryHeaderTemplate
Gets or sets the DataTemplate to display the category header.
public DataTemplate CategoryHeaderTemplate { get; set; }
Property Value
- DataTemplate:
The DataTemplate to display the category header.
HasCategoryHeaders
Gets or sets 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 istrue
.
IsFilterButtonVisible
Gets whether the filter button is visible.
public bool IsFilterButtonVisible { get; }
Property Value
- bool:
true
if the filter button is visible; otherwise,false
.
MaxColumnCount
Gets or sets the maximum number of columns.
public int MaxColumnCount { get; set; }
Property Value
MinColumnCount
Gets or sets the minimum number of columns.
public int MinColumnCount { get; set; }
Property Value
- int:
The minimum number of columns. The default value is
1
.
ResizeMode
Gets or sets a ControlResizeMode that indicates how the menu that contains the gallery can resize.
public ControlResizeMode ResizeMode { get; set; }
Property Value
- ControlResizeMode:
A ControlResizeMode that indicates how the menu that contains the gallery can resize. 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
SelectedFilterCategory
Gets or sets the selected filter category name.
[Localizability(LocalizationCategory.Title)]
public string SelectedFilterCategory { get; set; }
Property Value
- string:
The selected filter category name.
UseMenuItemAppearance
Gets or sets 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 isfalse
.
UseMenuItemIndent
Gets or sets 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 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
Identifies the AreSurroundingSeparatorsAllowed dependency property. This field is read-only.
public static readonly DependencyProperty AreSurroundingSeparatorsAllowedProperty
CanCategorizeProperty
Identifies the CanCategorize dependency property. This field is read-only.
public static readonly DependencyProperty CanCategorizeProperty
CanFilterProperty
Identifies the CanFilter dependency property. This field is read-only.
public static readonly DependencyProperty CanFilterProperty
CategoryContainerStyleProperty
Identifies the CategoryContainerStyle dependency property. This field is read-only.
public static readonly DependencyProperty CategoryContainerStyleProperty
CategoryHeaderTemplateProperty
Identifies the CategoryHeaderTemplate dependency property. This field is read-only.
public static readonly DependencyProperty CategoryHeaderTemplateProperty
HasCategoryHeadersProperty
Identifies the HasCategoryHeaders dependency property. This field is read-only.
public static readonly DependencyProperty HasCategoryHeadersProperty
IsFilterButtonVisibleProperty
Identifies the IsFilterButtonVisible dependency property. This field is read-only.
public static readonly DependencyProperty IsFilterButtonVisibleProperty
MaxColumnCountProperty
Identifies the MaxColumnCount dependency property. This field is read-only.
public static readonly DependencyProperty MaxColumnCountProperty
MinColumnCountProperty
Identifies the MinColumnCount dependency property. This field is read-only.
public static readonly DependencyProperty MinColumnCountProperty
ResizeModeProperty
Identifies the ResizeMode dependency property. This field is read-only.
public static readonly DependencyProperty ResizeModeProperty
SelectedFilterCategoryProperty
Identifies the SelectedFilterCategory dependency property. This field is read-only.
public static readonly DependencyProperty SelectedFilterCategoryProperty
UseMenuItemAppearanceProperty
Identifies the UseMenuItemAppearance dependency property. This field is read-only.
public static readonly DependencyProperty UseMenuItemAppearanceProperty
UseMenuItemIndentProperty
Identifies the UseMenuItemIndent dependency property. This field is read-only.
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.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.Title
- BarGalleryBase.UseAccentedItemBorder
- BarGalleryBase.UserInterfaceDensity
- BarGalleryBase.HighlightedItemChanged