BarGalleryViewModel Class
Represents a view model for a standard gallery control within a bar control.
public class BarGalleryViewModel : BarGalleryViewModelBase, IHasKey, IHasVariantImages
- Inheritance:
- object ObservableObjectBase BarKeyedObjectViewModelBase BarGalleryViewModelBase object
- Derived:
- BarComboBoxViewModel
- Implements:
- IHasKey IHasVariantImages
Constructors
BarGalleryViewModel()
Initializes a new instance of the class.
public BarGalleryViewModel()
BarGalleryViewModel(string?)
Initializes a new instance of the class with the specified key. The label and key tip text are auto-generated.
public BarGalleryViewModel(string? key)
Parameter | Type | Description |
---|---|---|
key | string | A string that uniquely identifies the control. |
BarGalleryViewModel(string?, IEnumerable?)
Initializes a new instance of the class with the specified key and items. The label and key tip text are auto-generated.
public BarGalleryViewModel(string? key, IEnumerable? items)
Parameter | Type | Description |
---|---|---|
key | string | A string that uniquely identifies the control. |
items | IEnumerable | The collection of gallery items, where the items are typically of type IBarGalleryItemViewModel. |
BarGalleryViewModel(string?, string?)
Initializes a new instance of the class with the specified key and label. The key tip text is auto-generated.
public BarGalleryViewModel(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 |
BarGalleryViewModel(string?, string?, IEnumerable?)
Initializes a new instance of the class with the specified key, label, and items. The key tip text is auto-generated.
public BarGalleryViewModel(string? key, string? label, IEnumerable? items)
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 |
items | IEnumerable | The collection of gallery items, where the items are typically of type IBarGalleryItemViewModel. |
BarGalleryViewModel(string?, string?, string?)
Initializes a new instance of the class with the specified key, label, and key tip text.
public BarGalleryViewModel(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 |
keyTipText | string | The key tip text, which is auto-generated from the |
BarGalleryViewModel(string?, string?, string?, IEnumerable?)
Initializes a new instance of the class with the specified key, label, key tip text, and items.
public BarGalleryViewModel(string? key, string? label, string? keyTipText, IEnumerable? items)
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 |
keyTipText | string | The key tip text, which is auto-generated from the |
items | IEnumerable | The collection of gallery items, where the items are typically of type IBarGalleryItemViewModel. |
BarGalleryViewModel(string?, string?, string?, ICommand?)
Initializes a new instance of the class with the specified key, label, key tip text, and command.
public BarGalleryViewModel(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 |
keyTipText | string | The key tip text, which is auto-generated from the |
command | ICommand | The command to attach to the control. |
BarGalleryViewModel(string?, string?, string?, ICommand?, IEnumerable?)
Initializes a new instance of the class with the specified key, label, key tip text, command, and items.
public BarGalleryViewModel(string? key, string? label, string? keyTipText, ICommand? command, IEnumerable? items)
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 |
keyTipText | string | The key tip text, which is auto-generated from the |
command | ICommand | The command to attach to the control. |
items | IEnumerable | The collection of gallery items, where the items are typically of type IBarGalleryItemViewModel. |
BarGalleryViewModel(string?, string?, ICommand?)
Initializes a new instance of the class with the specified key, label, and command. The key tip text is auto-generated.
public BarGalleryViewModel(string? key, string? label, 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 | ICommand | The command to attach to the control. |
BarGalleryViewModel(string?, string?, ICommand?, IEnumerable?)
Initializes a new instance of the class with the specified key, label, command, and items. The key tip text is auto-generated.
public BarGalleryViewModel(string? key, string? label, ICommand? command, IEnumerable? items)
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 | ICommand | The command to attach to the control. |
items | IEnumerable | The collection of gallery items, where the items are typically of type IBarGalleryItemViewModel. |
BarGalleryViewModel(string?, ICommand?)
Initializes a new instance of the class with the specified key and command. The label and key tip text are auto-generated.
public BarGalleryViewModel(string? key, ICommand? command)
Parameter | Type | Description |
---|---|---|
key | string | A string that uniquely identifies the control. |
command | ICommand | The command to attach to the control. |
BarGalleryViewModel(string?, ICommand?, IEnumerable?)
Initializes a new instance of the class with the specified key, command, and items. The label and key tip text are auto-generated.
public BarGalleryViewModel(string? key, ICommand? command, IEnumerable? items)
Parameter | Type | Description |
---|---|---|
key | string | A string that uniquely identifies the control. |
command | ICommand | The command to attach to the control. |
items | IEnumerable | The collection of gallery items, where the items are typically of type IBarGalleryItemViewModel. |
Properties
AboveMenuItems
The collection of menu items that appear above the menu gallery in a popup.
public ObservableCollection<object> AboveMenuItems { get; }
Property Value
BelowMenuItems
The collection of menu items that below above the menu gallery in a popup.
public ObservableCollection<object> BelowMenuItems { get; }
Property Value
CanCategorize
Indicates whether the gallery sorts and displays items by category when an ICollectionView is set to the ItemsSource
.
CanFilter
Indicates whether the gallery supports filtering of items by category.
CanRibbonAutoScrollToSelectedItem
Whether to automatically scroll a ribbon gallery to the selected item on selection changes.
public bool CanRibbonAutoScrollToSelectedItem { get; set; }
Property Value
- bool:
The default value is
false
.
CategoryHeaderTemplate
A Avalonia.Controls.Templates.IDataTemplate for category headers when categorization is enabled.
public IDataTemplate? CategoryHeaderTemplate { get; set; }
Property Value
- IDataTemplate
CollapsedButtonDescription
The text description to display in screen tips for the gallery when it is rendered as a collapsed button.
HasCategoryHeaders
Indicates whether the gallery has category headers when categorizing.
IsSelectionSupported
Indicates whether selection is supported by the gallery.
Items
The collection of gallery items.
KeyTipText
The key tip text used to access the control.
LargeIcon
The object representing a large icon, generally 32x32
size.
MaxMenuColumnCount
The maximum number of columns when in a menu.
MaxRibbonColumnCount
The maximum number of columns when in-ribbon.
MediumIcon
The object representing a medium icon, generally 24x24
size.
MenuResizeMode
A ControlResizeMode that indicates how the popup menu can resize.
public ControlResizeMode MenuResizeMode { get; set; }
Property Value
- ControlResizeMode:
The default value is None.
MinLargeRibbonColumnCount
The minimum number of columns to use when in-ribbon with a Large variant size.
MinMediumRibbonColumnCount
The minimum number of columns to use when in-ribbon with a Medium variant size.
MinMenuColumnCount
The minimum number of columns when in a menu.
PopupOpeningCommand
The ICommand that executes before the gallery's popup is opened, allowing its items to be customized in MVVM scenarios.
SelectedItem
The selected item.
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.
UseAccentedItemBorder
Indicates whether to use an accented item border for gallery items, common when they have vibrant content such as color swatches.
UseMenuItemAppearance
Indicates whether to use a menu item appearance for gallery items, common for single-column menu galleries.
UseMenuItemIndent
Indicates whether to align gallery items in a menu so that they indent past the menu's icon column.
Methods
CreateCollectionView(IEnumerable<IBarGalleryItemViewModel>, bool)
Creates a ICollectionView for the specified collection of gallery item view models, allowing for possible categorization and filtering.
public static ICollectionView CreateCollectionView(IEnumerable<IBarGalleryItemViewModel> items, bool categorize)
Parameter | Type | Description |
---|---|---|
items | IEnumerable<IBarGalleryItemViewModel> | The collection of gallery item view models to include in the collection view. |
categorize | bool | Whether the collection view source should support categorization by including a group description based on Category property values. |
Returns
- ICollectionView:
The ICollectionView of gallery item view models that was created.
SelectItemByValueMatch<T>(Func<T, bool>?)
Selects an item in the gallery that matches the predicate.
public virtual T? SelectItemByValueMatch<T>(Func<T, bool>? predicate) where T : IBarGalleryItemViewModel
- Type Parameters:
-
T
-The type of IBarGalleryItemViewModel to examine.
Parameter | Type | Description |
---|---|---|
predicate | Func<T, bool> | A predicate that determines when an item matches criteria. |
Returns
- T:
The IBarGalleryItemViewModel that was selected, if any.
Inherited Members
- BarGalleryViewModelBase.AreSurroundingSeparatorsAllowed
- BarGalleryViewModelBase.CanCloneToRibbonQuickAccessToolBar
- BarGalleryViewModelBase.Command
- BarGalleryViewModelBase.IsVisible
- BarGalleryViewModelBase.ItemContainerTheme
- BarGalleryViewModelBase.ItemSpacing
- BarGalleryViewModelBase.ItemTemplate
- BarGalleryViewModelBase.ItemTemplateSelector
- BarGalleryViewModelBase.Label
- BarGalleryViewModelBase.MinItemHeight
- BarGalleryViewModelBase.MinItemWidth
- BarGalleryViewModelBase.SmallIcon
- BarGalleryViewModelBase.Title
- BarKeyedObjectViewModelBase.ToString()
- BarKeyedObjectViewModelBase.Key
- ObservableObjectBase.OnPropertyChanged(string)
- ObservableObjectBase.OnPropertyChanged(PropertyChangedEventArgs)
- ObservableObjectBase.OnPropertyChanging(string)
- ObservableObjectBase.OnPropertyChanging(PropertyChangingEventArgs)
- ObservableObjectBase.SetProperty<T>(ref T, T, string)
- ObservableObjectBase.PropertyChanged
- ObservableObjectBase.PropertyChanging
- object.GetType()
- object.MemberwiseClone()
- object.Equals(object)
- object.Equals(object, object)
- object.ReferenceEquals(object, object)
- object.GetHashCode()