Represents a base ribbon control.
- Inheritance:
-
object
Visual
UIElement
Framework
Element Control object
- Derived:
-
Button
Base Separator
- Implements:
-
IKey
Tip ILogicalTarget Parent IVariantControl
Constructors
ControlBase()
Initializes an instance of the class.
Properties
CanUpdateCanExecuteWhenHidden
Gets whether the control gets its Update
Property Value
- bool:
true
if the control gets its UpdateCan method called even when it is hidden; otherwise,Execute() false
.
Command
Gets or sets the ICommand that is attached to the control.
CommandParameter
Gets or sets a user defined data value that can be passed to the Command when it is executed.
Property Value
CommandTarget
Gets or sets the object that the command is being executed on.
Property Value
- IInput
Element : The object that the command is being executed on.
Context
Gets or sets a Control
Property Value
- Control
Context : A Control
Context that describes the current context of the control.
HasImage
Gets whether the control has an image available for display.
Property Value
- bool:
true
if the control has an image available for display; otherwise,false
.
HasLabel
Gets whether the control has a label available for display.
Property Value
- bool:
true
if the control has a label available for display; otherwise,false
.
Id
Gets or sets the control ID, which can be used to identify the control.
Property Value
- string:
The control ID, which can be used to identify the control.
Remarks
When two controls of the same type have the same ID, they are considered the same for Quick Access ToolBar (QAT) customization purposes.
ImageSourceLarge
Gets or sets the Image
Property Value
- Image
Source : The Image
Source for the 32x32 image to display for the control.
ImageSourceSmall
Gets or sets the Image
Property Value
- Image
Source : The Image
Source for the 16x16 image to display for the control.
IsHighlighted
Gets or sets whether the control is currently highlighted in a menu.
Property Value
- bool:
true
if the control is currently highlighted in a menu; otherwise,false
.
KeyTipAccessText
Gets or sets the key tip access text for the control.
Property Value
- string:
The key tip access text for the control.
Label
Gets or sets the text label to display for the control.
Property Value
- string:
The text label to display for the control.
ScreenTipDescription
Gets or sets the description object that will be displayed in screen tips for the control.
Property Value
- object:
The description object that will be displayed in screen tips for the control.
ScreenTipFooter
Gets or sets the footer object that will be displayed in screen tips for the control.
Property Value
- object:
The footer object that will be displayed in screen tips for the control.
ScreenTipHeader
Gets or sets the header object that will be displayed in screen tips for the control.
Property Value
- object:
The header object that will be displayed in screen tips for the control.
ScreenTipHelpUri
Gets or sets the System.Uri specifying the location of context-sensitive help related to the control when its screen tip is displayed and F1
is pressed.
Property Value
- Uri:
The System.Uri specifying the location of context-sensitive help related to the control when its screen tip is displayed and
F1
is pressed.
ScreenTipImageSource
Gets or sets the Image
Property Value
- Image
Source : The Image
Source for the image that will be displayed in screen tips for the control.
VariantSize
Gets or sets a Variant
Property Value
- Variant
Size : A Variant
Size that indicates the control's current variant size. The default value isVariantSize.Medium
.
Methods
CoerceCommandParameter(DependencyObject, object)
Coerces a new Command
Parameter | Type | Description |
---|---|---|
obj | DependencyObject | The System.Windows.DependencyObject whose property is changed. |
value | object | The new value being set. |
Returns
- object:
The coerced value to set.
MeasureOverride(Size)
When overridden in a derived class, measures the size in layout required for child elements and
determines a size for the Framework
Parameter | Type | Description |
---|---|---|
constraint | Size | The available size that this element can give to child elements. Infinity can be specified as a value to indicate that the element will size to whatever content is available. |
Returns
- Size:
The size that this element determines it needs during layout, based on its calculations of child element sizes.
OnAccessKey(AccessKeyEventArgs)
Responds when the access key for this control is invoked.
Parameter | Type | Description |
---|---|---|
e | Access |
A Access |
OnClick(ExecuteRoutedEventArgs)
Called when the control is clicked and a Click event is raised.
Parameter | Type | Description |
---|---|---|
e | Execute |
An |
OnCommandChanged(ICommand, ICommand)
Occurs when the Command property is changed.
Parameter | Type | Description |
---|---|---|
oldCommand | ICommand | The old ICommand value. |
newCommand | ICommand | The new ICommand value. |
OnContextChanged(ControlContext, ControlContext)
Occurs when the Context property is changed.
Parameter | Type | Description |
---|---|---|
oldContext | Control |
The old Control |
newContext | Control |
The new Control |
OnCreateAutomationPeer()
Creates and returns an Automation
Returns
- Automation
Peer : The Automation
Peer that was created.
OnKeyTipAccessed(string)
Called when key tip access text for the control is typed by the end user.
Parameter | Type | Description |
---|---|---|
keyTipAccessText | string | The key tip access text that was typed. |
Returns
- bool:
true
if an action was executed that should stop key tip mode; otherwise,false
.
Remarks
Implementations of this method should either execute the action associated with the control or move focus to the control so that the end user can take further action such as in a menu.
OnPreviewClick(ExecuteRoutedEventArgs)
Raises the Preview
Parameter | Type | Description |
---|---|---|
e | Execute |
An |
OnPropertyChanged(DependencyPropertyChangedEventArgs)
Occurs when a property is changed.
Parameter | Type | Description |
---|---|---|
e | DependencyPropertyChangedEventArgs | A System.Windows.DependencyPropertyChangedEventArgs that contains the event data. |
OnScreenTipClosing(RoutedEventArgs)
Invoked when an unhandled Screen
Parameter | Type | Description |
---|---|---|
e | Routed |
A |
Remarks
This method has no default implementation. Because an intermediate class in the inheritance might implement this method, we recommend that you call the base implementation in your implementation.
OnScreenTipOpening(RoutedEventArgs)
Invoked when an unhandled Screen
Parameter | Type | Description |
---|---|---|
e | Routed |
A |
Remarks
This method has no default implementation. Because an intermediate class in the inheritance might implement this method, we recommend that you call the base implementation in your implementation.
OnVariantSizeChanged(VariantSize, VariantSize)
Occurs when the Variant
Parameter | Type | Description |
---|---|---|
oldVariantSize | Variant |
The old Variant |
newVariantSize | Variant |
The new Variant |
RaiseClickEvent(ExecuteRoutedEventArgs)
Called when the control is clicked to raise a Click event.
Parameter | Type | Description |
---|---|---|
e | Execute |
An |
ToString()
Creates and returns a string representation of the current object.
Returns
- string:
A string representation of the current object.
UpdateCanExecute()
Updates whether the command can execute.
Events
Click
Occurs after a click event occurs on the control.
Event Type
PreviewClick
Occurs when a click event is about to occur on the control, thereby causing any containing menus to close.
Event Type
ScreenTipClosing
Occurs before any screen tip on the control is closed.
Event Type
ScreenTipOpening
Occurs before any screen tip on the control is opened.
Event Type
Fields
ClickEvent
Identifies the Click routed event. This field is read-only.
CommandParameterProperty
Identifies the Command
CommandProperty
Identifies the Command dependency property. This field is read-only.
CommandTargetProperty
Identifies the Command
ContextProperty
Identifies the Context dependency property. This field is read-only.
HasImageProperty
Identifies the Has
HasLabelProperty
Identifies the Has
IdProperty
Identifies the Id dependency property. This field is read-only.
ImageSourceLargeProperty
Identifies the Image
ImageSourceSmallProperty
Identifies the Image
IsHighlightedProperty
Identifies the Is
KeyTipAccessTextProperty
Identifies the Key
LabelProperty
Identifies the Label dependency property. This field is read-only.
PreviewClickEvent
Identifies the Preview
ScreenTipClosingEvent
Identifies the Screen
ScreenTipDescriptionProperty
Identifies the Screen
ScreenTipFooterProperty
Identifies the Screen
ScreenTipHeaderProperty
Identifies the Screen
ScreenTipHelpUriProperty
Identifies the Screen
ScreenTipImageSourceProperty
Identifies the Screen
ScreenTipOpeningEvent
Identifies the Screen
VariantSizeProperty
Identifies the Variant