BarSizeSelectionMenuGallery Class

Represents a size selection gallery control, for use within a menu.

[TemplatePart(Name = "PART_CellHost", Type = typeof(Control))]
public class BarSizeSelectionMenuGallery : BarMenuGallery, IDataContextProvider, ILogical, IThemeVariantHost, IResourceHost, IResourceNode, IStyleHost, ISetLogicalParent, ISetInheritanceParent, IStyleable, INamed, IInputElement, IDataTemplateHost, ISetterValue, IChildIndexProvider, ICommandSource, IDragResizableControl
Inheritance:
object AvaloniaObject Animatable StyledElement Visual Layoutable Interactive InputElement Control TemplatedControl ItemsControl SelectingItemsControl BarGalleryBase BarMenuGallery object
Implements:
IDataContextProvider ILogical IThemeVariantHost IResourceHost IResourceNode IStyleHost ISetLogicalParent ISetInheritanceParent IStyleable INamed IInputElement IDataTemplateHost ISetterValue IChildIndexProvider ICommandSource IDragResizableControl

Constructors

BarSizeSelectionMenuGallery()

Initializes an instance of the class.

public BarSizeSelectionMenuGallery()

Properties

ColumnCount

The number of columns.

public int ColumnCount { get; set; }

Property Value

int:

The default value is 10.

DefaultHeadingText

The default heading text that is displayed above the menu gallery.

public string? DefaultHeadingText { get; set; }

Property Value

string

HeadingText

The current heading text that is displayed above the menu gallery.

public string? HeadingText { get; }

Property Value

string

RowCount

The number of rows.

public int RowCount { get; set; }

Property Value

int:

The default value is 8.

SizeHeadingTextFormat

The format string to use for the heading when the end user is selecting a size in the gallery.

public string? SizeHeadingTextFormat { get; set; }

Property Value

string

Remarks

The first parameter to the format string is the current width. The second parameter to the format string is the current height.

Methods

CreateItem(int, int)

Creates an item to represent the specified row and column indices.

protected virtual object CreateItem(int rowIndex, int columnIndex)
Parameter Type Description
rowIndex int

The zero-based row index.

columnIndex int

The zero-based column index.

Returns

object:

The item that was created, which by default is a Avalonia.Size with one-based values.

OnApplyTemplate(TemplateAppliedEventArgs)

Called when the control's template is applied. In simple terms, this means the method is called just before the control is displayed.

protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
Parameter Type Description
e TemplateAppliedEventArgs

The event args.

OnHighlightedItemChanged()

Invokes the HighlightedItemChanged event.

protected override void OnHighlightedItemChanged()

Fields

ColumnCountProperty

Defines the ColumnCount property.

public static readonly StyledProperty<int> ColumnCountProperty

DefaultHeadingTextProperty

Defines the DefaultHeadingText property.

public static readonly StyledProperty<string?> DefaultHeadingTextProperty

HeadingTextProperty

Defines the HeadingText property.

public static readonly StyledProperty<string?> HeadingTextProperty

RowCountProperty

Defines the RowCount property.

public static readonly StyledProperty<int> RowCountProperty

SizeHeadingTextFormatProperty

Defines the SizeHeadingTextFormat property.

public static readonly StyledProperty<string?> SizeHeadingTextFormatProperty

Inherited Members

Extension Methods