BarGalleryViewModel Class
Represents a view model for a standard gallery control within a bar control.
public class BarGalleryViewModel : BarGalleryViewModelBase, IHasKey, IHasTag, IHasVariantImages
- Inheritance:
- object ObservableObjectBase BarKeyedObjectViewModelBase BarGalleryViewModelBase object
- Derived:
- BarComboBoxViewModel
- Implements:
- IHasKey IHasTag IHasVariantImages
Constructors
BarGalleryViewModel()
Initializes an instance of the class.
public BarGalleryViewModel()
BarGalleryViewModel(string?)
Initializes an 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 an 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 an 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 an 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 an 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 an 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 an 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 an 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 an 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 an 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 an 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 an 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. |
BarGalleryViewModel(RoutedCommand?)
Initializes an instance of the class with the specified RoutedCommand, also used to auto-generate a key, label, and key tip text.
public BarGalleryViewModel(RoutedCommand? routedCommand)
| Parameter | Type | Description |
|---|---|---|
| routedCommand | RoutedCommand | The command to attach to the control. |
BarGalleryViewModel(RoutedCommand?, IEnumerable?)
Initializes an instance of the class with the specified items and RoutedCommand, also used to auto-generate a key, label, and key tip text.
public BarGalleryViewModel(RoutedCommand? routedCommand, IEnumerable? items)
| Parameter | Type | Description |
|---|---|---|
| routedCommand | RoutedCommand | 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 System.ComponentModel.ICollectionView is set to the ItemsSource.
public bool CanCategorize { get; set; }
Property Value
- bool:
trueif the gallery sorts and displays items by category when an System.ComponentModel.ICollectionView is set to theItemsSource; otherwise,false. The default value istrue.
CanFilter
Indicates whether the gallery supports filtering of items by category.
public bool CanFilter { get; set; }
Property Value
- bool:
trueif the gallery supports filtering of items by category; otherwise,false. The default value isfalse.
CanRibbonAutoScrollToSelectedItem
Indicates whether to automatically scroll a ribbon gallery to the selected item on selection changes.
public bool CanRibbonAutoScrollToSelectedItem { get; set; }
Property Value
- bool:
trueif the ribbon gallery selected item should automatically be scrolled into view on selection changes; otherwise,false. The default value isfalse.
CategoryHeaderTemplate
A DataTemplate for category headers when categorization is enabled.
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.
public bool HasCategoryHeaders { get; set; }
Property Value
- bool:
trueif the gallery has category headers when categorizing; otherwise,false. The default value istrue.
InvocationFocusBehavior
Indicates how the control processes focus when a commit occurs.
public InvocationFocusBehavior InvocationFocusBehavior { get; set; }
Property Value
- InvocationFocusBehavior:
The default value is Default.
IsSelectionSupported
Indicates whether selection is supported by the gallery.
public bool IsSelectionSupported { get; set; }
Property Value
- bool:
trueif selection is supported by the gallery; otherwise,false. The default value istrue.
IsSynchronizedWithCurrentItem
Indicates whether the gallery control should keep its SelectedItem property synchronized with the current item in its Items property.
public bool? IsSynchronizedWithCurrentItem { get; set; }
Property Value
- bool?:
trueif the SelectedItem is always synchronized with the current item in the Items;falseif the SelectedItem is never synchronized with the current item;nullif the SelectedItem is synchronized with the current item only if the gallery uses aCollectionView. The default value isnull.
Items
The collection of gallery items.
KeyTipText
The key tip text used to access the control.
LargeImageSource
The ImageSource for a large image, generally 32x32 size.
MaxMenuColumnCount
The maximum number of columns when in a menu.
MaxMenuGalleryHeight
The maximum height of the menu gallery in the popup.
public double MaxMenuGalleryHeight { get; set; }
Property Value
- double:
The default value is
1000.0.
MaxRibbonColumnCount
The maximum number of columns when in-ribbon.
MediumImageSource
The ImageSource for a medium image, 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.
PopupClosedCommand
The ICommand that executes after the gallery's popup is closed, allowing its items to be customized in MVVM scenarios.
PopupOpeningCommand
The ICommand that executes before the gallery's popup is opened, allowing its items to be customized in MVVM scenarios.
SelectedFilterCategory
The selected filter category.
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.
public bool UseAccentedItemBorder { get; set; }
Property Value
- bool:
trueif an accented item border should be used for gallery items; otherwise,false. The default value isfalse.
UseMenuItemAppearance
Indicates whether to use a menu item appearance for gallery items, common for single-column menu galleries.
public bool UseMenuItemAppearance { get; set; }
Property Value
- bool:
trueif gallery items should use a menu item appearance; otherwise,false. The default value isfalse.
UseMenuItemIndent
Indicates whether to align gallery items in a menu so that they indent past the menu's icon column.
public bool UseMenuItemIndent { get; set; }
Property Value
- bool:
trueif gallery items should be indented past the menu's icon column; otherwise,false. The default value isfalse.
Methods
CreateCollectionViewSource(IEnumerable<IBarGalleryItemViewModel>, bool)
Creates a CollectionViewSource for the specified collection of gallery item view models, allowing for possible categorization and filtering.
public static CollectionViewSource CreateCollectionViewSource(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
- CollectionViewSource:
The CollectionViewSource 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 BarGalleryViewModelBase that was selected.
Inherited Members
- BarGalleryViewModelBase.AreSurroundingSeparatorsAllowed
- BarGalleryViewModelBase.CanCloneToRibbonQuickAccessToolBar
- BarGalleryViewModelBase.Command
- BarGalleryViewModelBase.IsVisible
- BarGalleryViewModelBase.ItemContainerStyle
- BarGalleryViewModelBase.ItemContainerStyleSelector
- BarGalleryViewModelBase.ItemSpacing
- BarGalleryViewModelBase.ItemTemplate
- BarGalleryViewModelBase.ItemTemplateSelector
- BarGalleryViewModelBase.Label
- BarGalleryViewModelBase.MinItemHeight
- BarGalleryViewModelBase.MinItemWidth
- BarGalleryViewModelBase.SmallImageSource
- BarGalleryViewModelBase.Title
- BarKeyedObjectViewModelBase.ToString()
- BarKeyedObjectViewModelBase.Key
- BarKeyedObjectViewModelBase.Tag
- ObservableObjectBase.NotifyPropertyChanged(string)
- 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()