In This Article

BarPopupButtonViewModel Class

Represents a view model for a popup button control within a bar control.

public class BarPopupButtonViewModel : BarKeyedObjectViewModelBase, IHasKey, IHasTag, IHasVariantImages
Inheritance:
object ObservableObjectBase BarKeyedObjectViewModelBase object
Derived:
BarSplitButtonViewModel
Implements:
IHasKey IHasTag IHasVariantImages

Constructors

BarPopupButtonViewModel()

Initializes an instance of the class.

public BarPopupButtonViewModel()

BarPopupButtonViewModel(string?)

Initializes an instance of the class with the specified key. The label and key tip text are auto-generated.

public BarPopupButtonViewModel(string? key)
Parameter Type Description
key string

A string that uniquely identifies the control.

BarPopupButtonViewModel(string?, string?)

Initializes an instance of the class with the specified key and label. The key tip text is auto-generated.

public BarPopupButtonViewModel(string? key, string? label)
Parameter Type Description
key string

A string that uniquely identifies the control.

label string

The text label to display, which is auto-generated from the key if null.

BarPopupButtonViewModel(string?, string?, string?)

Initializes an instance of the class with the specified key, label, and key tip text.

public BarPopupButtonViewModel(string? key, string? label, string? keyTipText)
Parameter Type Description
key string

A string that uniquely identifies the control.

label string

The text label to display, which is auto-generated from the key if null.

keyTipText string

The key tip text, which is auto-generated from the label if null.

BarPopupButtonViewModel(string?, string?, string?, ICommand?)

Initializes an instance of the class with the specified key, label, key tip text, and command.

protected BarPopupButtonViewModel(string? key, string? label, string? keyTipText, ICommand? command)
Parameter Type Description
key string

A string that uniquely identifies the control.

label string

The text label to display, which is auto-generated from the command or key if null.

keyTipText string

The key tip text, which is auto-generated from the command or label if null.

command ICommand

The command to attach to the control.

Properties

CanCloneToRibbonQuickAccessToolBar

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

public bool CanCloneToRibbonQuickAccessToolBar { get; set; }

Property Value

bool:

true if the control can be cloned to the ribbon quick-access toolbar; otherwise, false. The default value is true.

Command

The ICommand to attach to the control.

public ICommand? Command { get; set; }

Property Value

ICommand

CommandParameter

The parameter to pass to the Command property.

public object? CommandParameter { get; set; }

Property Value

object

Description

The text description to display in screen tips.

public string? Description { get; set; }

Property Value

string

InvocationFocusBehavior

Indicates how the button outside of a menu context processes focus when it is clicked.

public InvocationFocusBehavior InvocationFocusBehavior { get; set; }

Property Value

InvocationFocusBehavior:

The default value is Default.

IsVisible

Indicates whether the control is currently visible.

public bool IsVisible { get; set; }

Property Value

bool:

The default value is true.

KeyTipText

The key tip text used to access the control.

public string? KeyTipText { get; set; }

Property Value

string

Label

The text label to display.

public string? Label { get; set; }

Property Value

string

LargeImageSource

The ImageSource for a large image, generally 32x32 size.

public ImageSource? LargeImageSource { get; set; }

Property Value

ImageSource

MediumImageSource

The ImageSource for a medium image, generally 24x24 size.

public ImageSource? MediumImageSource { get; set; }

Property Value

ImageSource

MenuItems

The collection of menu items that appear within the popup.

public ObservableCollection<object> MenuItems { get; }

Property Value

ObservableCollection<object>

PopupClosedCommand

The ICommand that executes after the button's popup is closed, allowing its items to be customized in MVVM scenarios.

public ICommand? PopupClosedCommand { get; set; }

Property Value

ICommand

PopupOpeningCommand

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

public ICommand? PopupOpeningCommand { get; set; }

Property Value

ICommand

SmallImageSource

The ImageSource for a small image, generally 16x16 size.

public ImageSource? SmallImageSource { get; set; }

Property Value

ImageSource

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.

UseLargeMenuItem

Indicates whether to use a large size when the control is a menu item.

public bool UseLargeMenuItem { get; set; }

Property Value

bool:

true if a large size should be used when the control is a menu item; otherwise, false. The default value is false.

Inherited Members

Extension Methods