In This Article

BarPopupButton Class

Represents a popup button control, for use within a ribbon or toolbar.

[PseudoClasses(new string[] { ":variant-small", ":variant-medium", ":variant-large" })]
[PseudoClasses(new string[] { ":image-only", ":label-only", ":image-and-label" })]
[PseudoClasses(new string[] { ":layout-orientation-vertical" })]
public class BarPopupButton : BarPopupButtonBase, IDataContextProvider, IThemeVariantHost, IResourceHost, IResourceNode, IStyleHost, ISetLogicalParent, ISetInheritanceParent, IStyleable, INamed, IDataTemplateHost, ISetterValue, IChildIndexProvider, IFocusScope, IInputElement, ILogical, ICommandSource
Inheritance:
object AvaloniaObject Animatable StyledElement Visual Layoutable Interactive InputElement Control TemplatedControl ItemsControl SelectingItemsControl MenuBase BarPopupButtonBase object
Derived:
BarSplitButton RibbonGalleryCollapsedButton
Implements:
IDataContextProvider IThemeVariantHost IResourceHost IResourceNode IStyleHost ISetLogicalParent ISetInheritanceParent IStyleable INamed IDataTemplateHost ISetterValue IChildIndexProvider IFocusScope IInputElement ILogical ICommandSource

Constructors

BarPopupButton()

Initializes a new instance of the class.

public BarPopupButton()

Properties

CanCloneToRibbonQuickAccessToolBar

Whether the control can be cloned to the ribbon quick-access toolbar.

public bool CanCloneToRibbonQuickAccessToolBar { get; set; }

Property Value

bool:

The default value is true.

IconResolved

The resolved object representing the icon to use in the control's template.

public object? IconResolved { get; }

Property Value

object

InputGesture

The input gesture text to display in menu items and screen tips.

public KeyGesture? InputGesture { get; set; }

Property Value

KeyGesture

IsInputGestureTextVisible

Indicates whether the input gesture text is allowed to be visible in the user interface.

public bool IsInputGestureTextVisible { get; set; }

Property Value

bool:

The default value is true.

Key

A string that uniquely identifies the control.

public string? Key { get; set; }

Property Value

string

LargeIcon

The object representing a large icon, generally 32x32 size.

public object? LargeIcon { get; set; }

Property Value

object

MediumIcon

The object representing a medium icon, generally 24x24 size.

public object? MediumIcon { get; set; }

Property Value

object

ScreenTipFooter

The screen tip footer content.

public object? ScreenTipFooter { get; set; }

Property Value

object

ScreenTipHeader

The screen tip header content.

public object? ScreenTipHeader { get; set; }

Property Value

object

SmallIcon

The object representing a small icon, generally 16x16 size.

public object? SmallIcon { get; set; }

Property Value

object

Title

The string title, which can override the Label when displayed in screen tips and customization UI.

public string? Title { get; set; }

Property Value

string

ToolBarItemCollapseBehavior

The ItemCollapseBehavior for the control when in a ribbon using Simplified layout mode.

public ItemCollapseBehavior ToolBarItemCollapseBehavior { get; set; }

Property Value

ItemCollapseBehavior:

The default value is Default.

ToolBarItemVariantBehavior

The ItemVariantBehavior for the control when in a toolbar, which also applies when in a ribbon using Simplified layout mode.

public ItemVariantBehavior ToolBarItemVariantBehavior { get; set; }

Property Value

ItemVariantBehavior:

The default value is AlwaysSmall.

VariantSize

The VariantSize currently assigned to the control. This property should only be manually set when the control is standalone, and not hosted by a bar control.

public VariantSize VariantSize { get; set; }

Property Value

VariantSize:

The default value is Small.

Methods

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.

OnCreateAutomationPeer()

Returns a new, type-specific Avalonia.Automation.Peers.AutomationPeer implementation for the control.

protected override AutomationPeer OnCreateAutomationPeer()

Returns

AutomationPeer:

The type-specific Avalonia.Automation.Peers.AutomationPeer implementation.

ToString()

Returns the string representation of this object.

public override string ToString()

Returns

string:

The string representation of this object.

Fields

CanCloneToRibbonQuickAccessToolBarProperty

Defines the CanCloneToRibbonQuickAccessToolBar property.

public static readonly StyledProperty<bool> CanCloneToRibbonQuickAccessToolBarProperty

IconResolvedProperty

Defines the IconResolved property.

public static readonly StyledProperty<object?> IconResolvedProperty

InputGestureProperty

Defines the InputGesture property.

public static readonly StyledProperty<KeyGesture?> InputGestureProperty

IsInputGestureTextVisibleProperty

Defines the IsInputGestureTextVisible property.

public static readonly StyledProperty<bool> IsInputGestureTextVisibleProperty

KeyProperty

Defines the Key property.

public static readonly StyledProperty<string?> KeyProperty

LargeIconProperty

Defines the LargeIcon property.

public static readonly StyledProperty<object?> LargeIconProperty

MediumIconProperty

Defines the MediumIcon property.

public static readonly StyledProperty<object?> MediumIconProperty

ScreenTipFooterProperty

Defines the ScreenTipFooter property.

public static readonly StyledProperty<object?> ScreenTipFooterProperty

ScreenTipHeaderProperty

Defines the ScreenTipHeader property.

public static readonly StyledProperty<object?> ScreenTipHeaderProperty

SmallIconProperty

Defines the SmallIcon property.

public static readonly StyledProperty<object?> SmallIconProperty

TitleProperty

Defines the Title property.

public static readonly StyledProperty<string?> TitleProperty

ToolBarItemCollapseBehaviorProperty

Defines the ToolBarItemCollapseBehavior property.

public static readonly StyledProperty<ItemCollapseBehavior> ToolBarItemCollapseBehaviorProperty

ToolBarItemVariantBehaviorProperty

Defines the ToolBarItemVariantBehavior property.

public static readonly StyledProperty<ItemVariantBehavior> ToolBarItemVariantBehaviorProperty

VariantSizeProperty

Defines the VariantSize property.

public static readonly StyledProperty<VariantSize> VariantSizeProperty

Inherited Members

Extension Methods