BarComboBoxViewModel Class
Represents a view model for a combobox control within a bar control.
public class BarComboBoxViewModel : BarGalleryViewModel, IHasKey, IHasTag, IHasVariantImages
- Inheritance:
- object ObservableObjectBase BarKeyedObjectViewModelBase BarGalleryViewModelBase BarGalleryViewModel object
- Implements:
- IHasKey IHasTag IHasVariantImages
Constructors
BarComboBoxViewModel()
Initializes an instance of the class.
public BarComboBoxViewModel()
BarComboBoxViewModel(string?)
Initializes an instance of the class with the specified key. The label and key tip text are auto-generated.
public BarComboBoxViewModel(string? key)
| Parameter | Type | Description |
|---|---|---|
| key | string | A string that uniquely identifies the control. |
BarComboBoxViewModel(string?, IEnumerable?)
Initializes an instance of the class with the specified key and items. The label and key tip text are auto-generated.
public BarComboBoxViewModel(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. |
BarComboBoxViewModel(string?, string?)
Initializes an instance of the class with the specified key and label. The key tip text is auto-generated.
public BarComboBoxViewModel(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 |
BarComboBoxViewModel(string?, string?, IEnumerable?)
Initializes an instance of the class with the specified key, label, and items. The key tip text is auto-generated.
public BarComboBoxViewModel(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. |
BarComboBoxViewModel(string?, string?, string?)
Initializes an instance of the class with the specified key, label, and key tip text.
public BarComboBoxViewModel(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 |
BarComboBoxViewModel(string?, string?, string?, IEnumerable?)
Initializes an instance of the class with the specified key, label, key tip text, and items.
public BarComboBoxViewModel(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. |
BarComboBoxViewModel(string?, string?, string?, ICommand?)
Initializes an instance of the class with the specified key, label, key tip text, and command.
public BarComboBoxViewModel(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. |
BarComboBoxViewModel(string?, string?, string?, ICommand?, IEnumerable?)
Initializes an instance of the class with the specified key, label, key tip text, command, and items.
public BarComboBoxViewModel(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. |
BarComboBoxViewModel(string?, string?, ICommand?)
Initializes an instance of the class with the specified key, label, and command. The key tip text is auto-generated.
public BarComboBoxViewModel(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. |
BarComboBoxViewModel(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 BarComboBoxViewModel(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. |
BarComboBoxViewModel(string?, ICommand?)
Initializes an instance of the class with the specified key and command. The label and key tip text are auto-generated.
public BarComboBoxViewModel(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. |
BarComboBoxViewModel(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 BarComboBoxViewModel(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. |
BarComboBoxViewModel(RoutedCommand?)
Initializes an instance of the class with the specified RoutedCommand, also used to auto-generate a key, label, and key tip text.
public BarComboBoxViewModel(RoutedCommand? routedCommand)
| Parameter | Type | Description |
|---|---|---|
| routedCommand | RoutedCommand | The command to attach to the control. |
BarComboBoxViewModel(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 BarComboBoxViewModel(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
Description
The text description to display in screen tips.
InlineImageSourcePath
The path to an ImageSource gallery item property, corresponding to optional inline image display.
IsEditable
Indicates whether the combobox is editable.
public bool IsEditable { get; set; }
Property Value
- bool:
trueif the combobox is editable; otherwise,false. The default value isfalse.
IsPreviewEnabledWhenPopupClosed
Indicates whether an editable combobox will preview a gallery item if the item is matched by typed text while the popup is closed.
public bool IsPreviewEnabledWhenPopupClosed { get; set; }
Property Value
- bool:
trueif an editable combobox will preview a gallery item if the item is matched by typed text while the popup is closed; otherwise,false. The default value isfalse.
IsReadOnly
Indicates whether the combobox is read-only.
public bool IsReadOnly { get; set; }
Property Value
- bool:
trueif the combobox is read-only; otherwise,false. The default value isfalse.
IsStarSizingAllowed
Indicates whether the control can star-size and fill available space when appropriate.
public bool IsStarSizingAllowed { get; set; }
Property Value
- bool:
trueif the control can star-size; otherwise,false. The default value isfalse.
IsTextCompletionEnabled
Indicates whether the control will attempt to complete typed text with a matching item.
public bool IsTextCompletionEnabled { get; set; }
Property Value
- bool:
trueif the control will attempt to complete typed text with a matching item; otherwise,false. The default value istrue.
IsTextSearchCaseSensitive
Indicates whether case is a condition when searching for items.
public bool IsTextSearchCaseSensitive { get; set; }
Property Value
- bool:
trueif text searches are case-sensitive; otherwisefalse. The default value isfalse.
See Also
IsTextSearchEnabled
Indicates whether known items are matched when text is entered.
public bool IsTextSearchEnabled { get; set; }
Property Value
- bool:
trueif items are matched when text is entered; otherwisefalse. The default value istrue.
See Also
IsUnmatchedTextAllowed
Indicates whether committed Text that is unable to be matched to a gallery item will raise the UnmatchedTextCommand and possibly be allowed.
public bool IsUnmatchedTextAllowed { get; set; }
Property Value
- bool:
trueif committed Text that is unable to be matched to a gallery item will raise the UnmatchedTextCommand and possibly be allowed; otherwise,false. The default value istrue.
See Also
MaxPopupHeight
The maximum popup height.
public double MaxPopupHeight { get; set; }
Property Value
- double:
The default value is
Double.PositiveInfinity.
PlaceholderText
The placeholder text to display when the control is empty.
RequestedWidth
The requested width of the control.
Text
The text to display in the control.
TextPath
The path to a string gallery item property, corresponding to Text display and entry.
UnmatchedTextCommand
The ICommand to execute when Text is committed that is unable to be matched to a gallery item
or when IsTextSearchEnabled is false.
public ICommand? UnmatchedTextCommand { get; set; }
Property Value
Remarks
This command is only used when the IsUnmatchedTextAllowed property is true.
The unmatched text string is passed as a command parameter.
When the command is null or CanExecute(object) returns true, the text will be committed; otherwise, it will not be committed.
See Also
Methods
SelectItemByTextMatch<T>(Func<T, string>, string)
Selects an item in the gallery whose text representation matches the specified text,
public virtual void SelectItemByTextMatch<T>(Func<T, string> getItemTextFunc, string text) where T : IBarGalleryItemViewModel
- Type Parameters:
-
T-The type of IBarGalleryItemViewModel to examine.
| Parameter | Type | Description |
|---|---|---|
| getItemTextFunc | Func<T, string> | A function that examines an item and returns its string value for comparison to |
| text | string | The text for which to search and that will be set to Text. |
SelectItemByValueMatch<T>(Func<T, bool>, Func<T, string>, string)
Selects an item in the gallery that matches the predicate, alternatively setting the specified fallback Text if no match is made.
public virtual void SelectItemByValueMatch<T>(Func<T, bool> matchPredicate, Func<T, string> getMatchedItemTextFunc, string fallbackText) where T : IBarGalleryItemViewModel
- Type Parameters:
-
T-The type of IBarGalleryItemViewModel to examine.
| Parameter | Type | Description |
|---|---|---|
| matchPredicate | Func<T, bool> | A predicate that determines when an item matches criteria. |
| getMatchedItemTextFunc | Func<T, string> | A function that examines a matched item and returns the string value to set to Text. |
| fallbackText | string | The fallback text to set to Text when there is no match. |
Inherited Members
- BarGalleryViewModel.CreateCollectionViewSource(IEnumerable<IBarGalleryItemViewModel>, bool)
- BarGalleryViewModel.SelectItemByValueMatch<T>(Func<T, bool>)
- BarGalleryViewModel.AboveMenuItems
- BarGalleryViewModel.BelowMenuItems
- BarGalleryViewModel.CanCategorize
- BarGalleryViewModel.CanFilter
- BarGalleryViewModel.CanRibbonAutoScrollToSelectedItem
- BarGalleryViewModel.CategoryHeaderTemplate
- BarGalleryViewModel.CollapsedButtonDescription
- BarGalleryViewModel.HasCategoryHeaders
- BarGalleryViewModel.InvocationFocusBehavior
- BarGalleryViewModel.IsSelectionSupported
- BarGalleryViewModel.IsSynchronizedWithCurrentItem
- BarGalleryViewModel.Items
- BarGalleryViewModel.KeyTipText
- BarGalleryViewModel.LargeImageSource
- BarGalleryViewModel.MaxMenuColumnCount
- BarGalleryViewModel.MaxMenuGalleryHeight
- BarGalleryViewModel.MaxRibbonColumnCount
- BarGalleryViewModel.MediumImageSource
- BarGalleryViewModel.MenuResizeMode
- BarGalleryViewModel.MinLargeRibbonColumnCount
- BarGalleryViewModel.MinMediumRibbonColumnCount
- BarGalleryViewModel.MinMenuColumnCount
- BarGalleryViewModel.PopupClosedCommand
- BarGalleryViewModel.PopupOpeningCommand
- BarGalleryViewModel.SelectedFilterCategory
- BarGalleryViewModel.SelectedItem
- BarGalleryViewModel.ToolBarItemCollapseBehavior
- BarGalleryViewModel.ToolBarItemVariantBehavior
- BarGalleryViewModel.UseAccentedItemBorder
- BarGalleryViewModel.UseMenuItemAppearance
- BarGalleryViewModel.UseMenuItemIndent
- 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()