BarButtonViewModel Class
Represents a view model for a regular button control within a bar control.
public class BarButtonViewModel : BarKeyedObjectViewModelBase, IHasKey, IHasVariantImages
- Inheritance:
- object ObservableObjectBase BarKeyedObjectViewModelBase object
- Derived:
- BarToggleButtonViewModel
- Implements:
- IHasKey IHasVariantImages
Constructors
BarButtonViewModel()
Initializes a new instance of the class.
public BarButtonViewModel()
BarButtonViewModel(string)
Initializes a new instance of the class with the specified key. The label and key tip text are auto-generated.
public BarButtonViewModel(string key)
Parameter | Type | Description |
---|---|---|
key | string | A string that uniquely identifies the control. |
BarButtonViewModel(string, string)
Initializes a new instance of the class with the specified key and label. The key tip text is auto-generated.
public BarButtonViewModel(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 |
BarButtonViewModel(string, string, string)
Initializes a new instance of the class with the specified key, label, and key tip text.
public BarButtonViewModel(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 |
BarButtonViewModel(string, string, string, ICommand)
Initializes a new instance of the class with the specified key, label, key tip text, and command.
public BarButtonViewModel(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. |
BarButtonViewModel(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 BarButtonViewModel(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. |
BarButtonViewModel(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 BarButtonViewModel(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. |
BarButtonViewModel(RoutedCommand)
Initializes a new instance of the class with the specified RoutedCommand, also used to auto-generate a key, label, and key tip text.
public BarButtonViewModel(RoutedCommand routedCommand)
Parameter | Type | Description |
---|---|---|
routedCommand | RoutedCommand | The command to attach to the control. |
Properties
CanCloneToRibbonQuickAccessToolBar
Gets or sets 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 istrue
.
Command
Gets or sets the ICommand to attach to the control.
public ICommand Command { get; set; }
Property Value
CommandParameter
Gets or sets the parameter to pass to the Command property.
public object CommandParameter { get; set; }
Property Value
Description
Gets or sets the text description to display in screen tips.
public string Description { get; set; }
Property Value
- string:
The text description to display in screen tips.
InputGestureText
Gets or sets the input gesture text to display in menu items and screen tips, which overrides any auto-generated input gesture text from the Command.
public string InputGestureText { get; set; }
Property Value
- string:
The input gesture text to display in menu items and screen tips.
IsInputGestureTextVisible
Gets or sets whether the input gesture text is allowed to be visible in the user interface.
public bool IsInputGestureTextVisible { get; set; }
Property Value
- bool:
true
if the input gesture text is allowed to be visible in the user interface; otherwise,false
. The default value istrue
.
IsVisible
Gets or sets whether the control is currently visible.
KeyTipText
Gets or sets the key tip text used to access the control.
public string KeyTipText { get; set; }
Property Value
- string:
The key tip text used to access the control.
Label
Gets or sets the text label to display.
LargeImageSource
Gets or sets the ImageSource for a large image, generally 32x32
size.
public ImageSource LargeImageSource { get; set; }
Property Value
- ImageSource:
The ImageSource for a large image.
MediumImageSource
Gets or sets the ImageSource for a medium image, generally 24x24
size.
public ImageSource MediumImageSource { get; set; }
Property Value
- ImageSource:
The ImageSource for a medium image.
SmallImageSource
Gets or sets the ImageSource for a small image, generally 16x16
size.
public ImageSource SmallImageSource { get; set; }
Property Value
- ImageSource:
The ImageSource for a small image.
StaysOpenOnClick
Gets or sets whether menus should try and remain open when the control is clicked.
public bool StaysOpenOnClick { get; set; }
Property Value
- bool:
true
if menus should try and remain open when the control is clicked; otherwise,false
. The default value isfalse
.
Title
Gets or sets the string title, which can override the Label when displayed in screen tips and customization UI.
ToolBarItemCollapseBehavior
Gets or sets the ItemCollapseBehavior for the control when in a ribbon using Simplified layout mode.
public ItemCollapseBehavior ToolBarItemCollapseBehavior { get; set; }
Property Value
- ItemCollapseBehavior:
The ItemCollapseBehavior for the control when in a ribbon using Simplified layout mode. The default value is
Default
.
ToolBarItemVariantBehavior
Gets or sets 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 ItemVariantBehavior for the control when in a toolbar, which also applies when in a ribbon using Simplified layout mode. The default value is
AlwaysSmall
.
UseLargeMenuItem
Gets or sets 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 isfalse
.
Inherited Members
- BarKeyedObjectViewModelBase.ToString()
- BarKeyedObjectViewModelBase.Key
- ObservableObjectBase.NotifyPropertyChanged(string)
- ObservableObjectBase.OnPropertyChanged(PropertyChangedEventArgs)
- ObservableObjectBase.SetProperty<T>(ref T, T, string)
- ObservableObjectBase.PropertyChanged
- object.GetType()
- object.MemberwiseClone()
- object.Equals(object)
- object.Equals(object, object)
- object.ReferenceEquals(object, object)
- object.GetHashCode()