In This Article

BarMenuGalleryHostBase Class

Represents an abstract base class for a gallery control that can host a related BarMenuGallery in its popup.

public abstract class BarMenuGalleryHostBase : BarGalleryBase, IDataContextProvider, ILogical, IThemeVariantHost, IResourceHost, IResourceNode, IStyleHost, ISetLogicalParent, ISetInheritanceParent, IStyleable, INamed, IInputElement, IDataTemplateHost, ISetterValue, IChildIndexProvider, ICommandSource
Inheritance:
object AvaloniaObject Animatable StyledElement Visual Layoutable Interactive InputElement Control TemplatedControl ItemsControl SelectingItemsControl BarGalleryBase object
Derived:
BarComboBox RibbonGallery
Implements:
IDataContextProvider ILogical IThemeVariantHost IResourceHost IResourceNode IStyleHost ISetLogicalParent ISetInheritanceParent IStyleable INamed IInputElement IDataTemplateHost ISetterValue IChildIndexProvider ICommandSource

Constructors

BarMenuGalleryHostBase()

Initializes an instance of the class.

protected BarMenuGalleryHostBase()

Properties

AboveMenuItems

The collection of menu items that appear above the implicitly-created menu gallery in this gallery's popup.

public IList? AboveMenuItems { get; set; }

Property Value

IList:

The default value is an empty list.

Remarks

This property is only used when the control is not created via MVVM.

See Also

AreSurroundingSeparatorsAllowedOnMenu

Whether the implicitly-created menu gallery in this gallery's popup can render surrounding separators.

public bool AreSurroundingSeparatorsAllowedOnMenu { get; set; }

Property Value

bool:

The default value is true.

Remarks

This property is only used when the control is not created via MVVM.

BelowMenuItems

The collection of menu items that appear below the implicitly-created menu gallery in this gallery's popup.

public IList? BelowMenuItems { get; set; }

Property Value

IList:

The default value is an empty list.

Remarks

This property is only used when the control is not created via MVVM.

See Also

CanCategorizeOnMenu

Whether the implicitly-created menu gallery in this gallery's popup sorts and displays items by category when an ICollectionView is set to the ItemsSource.

public bool CanCategorizeOnMenu { get; set; }

Property Value

bool:

The default value is true.

Remarks

This property is only used when the control is not created via MVVM.

CanFilterOnMenu

Whether the implicitly-created menu gallery in this gallery's popup supports filtering of items by category.

public bool CanFilterOnMenu { get; set; }

Property Value

bool:

The default value is false.

Remarks

This property is only used when the control is not created via MVVM.

CategoryHeaderTemplate

The Avalonia.Controls.Templates.IDataTemplate to display the category header on the implicitly-created menu gallery in this gallery's popup.

public IDataTemplate? CategoryHeaderTemplate { get; set; }

Property Value

IDataTemplate

Remarks

This property is only used when the control is not created via MVVM.

HasCategoryHeadersOnMenu

Whether the implicitly-created menu gallery in this gallery's popup has category headers when categorizing.

public bool HasCategoryHeadersOnMenu { get; set; }

Property Value

bool:

The default value is true.

Remarks

This property is only used when the control is not created via MVVM.

ItemTemplateSelector

The IDataTemplateSelector that selects a content template based on a data item and container control

public IDataTemplateSelector? ItemTemplateSelector { get; set; }

Property Value

IDataTemplateSelector

MaxMenuColumnCount

The maximum number of columns in the implicitly-created menu gallery in this gallery's popup.

public int MaxMenuColumnCount { get; set; }

Property Value

int:

The default value is MaxValue.

Remarks

This property is only used when the control is not created via MVVM.

MenuResizeMode

A ControlResizeMode that indicates how the popup menu can resize.

public ControlResizeMode MenuResizeMode { get; set; }

Property Value

ControlResizeMode:

The default value is None.

Remarks

This property is only used when the control is not created via MVVM.

MinMenuColumnCount

The minimum number of columns in the implicitly-created menu gallery in this gallery's popup.

public int MinMenuColumnCount { get; set; }

Property Value

int:

The default value is 1.

Remarks

This property is only used when the control is not created via MVVM.

PopupOpeningCommand

The ICommand that executes before the gallery's popup is opened, allowing its items to be customized in MVVM scenarios.

public ICommand? PopupOpeningCommand { get; set; }

Property Value

ICommand

SelectedFilterCategory

The selected filter category name.

public string? SelectedFilterCategory { get; set; }

Property Value

string

UseMenuItemAppearance

Whether to use a menu item appearance for gallery items, common for single-column menu galleries.

public bool UseMenuItemAppearance { get; set; }

Property Value

bool:

The default value is false.

Remarks

This property is only used when the control is not created via MVVM.

UseMenuItemIndent

Whether to align gallery items in the implicitly-created menu gallery in this gallery's popup so that they indent past the menu's icon column.

public bool UseMenuItemIndent { get; set; }

Property Value

bool:

The default value is false.

Remarks

This property is only used when the control is not created via MVVM.

Methods

PrepareContainerForItemOverride(Control, object?, int)

Prepares the specified element to display the specified item.

protected override void PrepareContainerForItemOverride(Control container, object? item, int index)
Parameter Type Description
container Control

The element that's used to display the specified item.

item object

The item to display.

index int

The index of the item to display.

Fields

AboveMenuItemsProperty

Defines the AboveMenuItems property.

public static readonly StyledProperty<IList?> AboveMenuItemsProperty

AreSurroundingSeparatorsAllowedOnMenuProperty

public static readonly StyledProperty<bool> AreSurroundingSeparatorsAllowedOnMenuProperty

BelowMenuItemsProperty

Defines the BelowMenuItems property.

public static readonly StyledProperty<IList?> BelowMenuItemsProperty

CanCategorizeOnMenuProperty

Defines the CanCategorizeOnMenu property.

public static readonly StyledProperty<bool> CanCategorizeOnMenuProperty

CanFilterOnMenuProperty

Defines the CanFilterOnMenu property.

public static readonly StyledProperty<bool> CanFilterOnMenuProperty

CategoryHeaderTemplateProperty

Defines the CategoryHeaderTemplate property.

public static readonly StyledProperty<IDataTemplate?> CategoryHeaderTemplateProperty

HasCategoryHeadersOnMenuProperty

Defines the HasCategoryHeadersOnMenu property.

public static readonly StyledProperty<bool> HasCategoryHeadersOnMenuProperty

ItemTemplateSelectorProperty

Defines the ItemTemplateSelector property.

public static readonly StyledProperty<IDataTemplateSelector?> ItemTemplateSelectorProperty

MaxMenuColumnCountProperty

Defines the MaxMenuColumnCount property.

public static readonly StyledProperty<int> MaxMenuColumnCountProperty

MenuResizeModeProperty

Defines the MenuResizeMode property.

public static readonly StyledProperty<ControlResizeMode> MenuResizeModeProperty

MinMenuColumnCountProperty

Defines the MinMenuColumnCount property.

public static readonly StyledProperty<int> MinMenuColumnCountProperty

PopupOpeningCommandProperty

Defines the PopupOpeningCommand property.

public static readonly StyledProperty<ICommand?> PopupOpeningCommandProperty

SelectedFilterCategoryProperty

Defines the SelectedFilterCategory property.

public static readonly StyledProperty<string?> SelectedFilterCategoryProperty

UseMenuItemAppearanceProperty

Defines the UseMenuItemAppearance property.

public static readonly StyledProperty<bool> UseMenuItemAppearanceProperty

UseMenuItemIndentProperty

Defines the UseMenuItemIndent property.

public static readonly StyledProperty<bool> UseMenuItemIndentProperty

Inherited Members

Extension Methods