Button Class
Represents a button ribbon control.
public class Button : ButtonBase, IKeyTipTarget, ILogicalParent, IVariantControl
- Inheritance:
- object Visual UIElement FrameworkElement Control ControlBase ButtonBase object
- Derived:
- ToggleMinimizationButton
- Implements:
- IKeyTipTarget ILogicalParent IVariantControl
Remarks
For detailed documentation on this control's features and how to use them, please see the Button documentation topic.
Constructors
Button()
Initializes an instance of the Button
class.
public Button()
Button(ICommand)
Initializes an instance of the Button
class.
public Button(ICommand command)
Parameter | Type | Description |
---|---|---|
command | ICommand | The ICommand to assign to the button. |
Methods
CoerceCommandParameter(DependencyObject, object)
Coerces a new CommandParameterProperty value.
protected override object CoerceCommandParameter(DependencyObject obj, object value)
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.
OnContextChanged(ControlContext, ControlContext)
Occurs when the Context property is changed.
protected override void OnContextChanged(ControlContext oldContext, ControlContext newContext)
Parameter | Type | Description |
---|---|---|
oldContext | ControlContext | The old ControlContext value. |
newContext | ControlContext | The new ControlContext value. |
OnKeyTipAccessed(string)
Called when key tip access text for the control is typed by the end user.
protected override bool OnKeyTipAccessed(string keyTipAccessText)
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.
OnVariantSizeChanged(VariantSize, VariantSize)
Occurs when the VariantSize property is changed.
protected override void OnVariantSizeChanged(VariantSize oldVariantSize, VariantSize newVariantSize)
Parameter | Type | Description |
---|---|---|
oldVariantSize | VariantSize | The old VariantSize value. |
newVariantSize | VariantSize | The new VariantSize value. |
Inherited Members
- ButtonBase.CheckedEvent
- ButtonBase.IndeterminateEvent
- ButtonBase.UncheckedEvent
- ButtonBase.ClickModeProperty
- ButtonBase.HasPopupProperty
- ButtonBase.ImageSourceSmallSizeProperty
- ButtonBase.InputGestureTextProperty
- ButtonBase.IsCheckedProperty
- ButtonBase.IsPointerOverProperty
- ButtonBase.IsPressedProperty
- ButtonBase.MenuItemDescriptionProperty
- ButtonBase.StaysOpenOnClickProperty
- ButtonBase.MeasureOverride(Size)
- ButtonBase.OnChecked()
- ButtonBase.OnClick(ExecuteRoutedEventArgs)
- ButtonBase.OnCommandChanged(ICommand, ICommand)
- ButtonBase.OnCreateAutomationPeer()
- ButtonBase.OnIndeterminate()
- ButtonBase.OnKeyDown(KeyEventArgs)
- ButtonBase.OnKeyUp(KeyEventArgs)
- ButtonBase.OnLostKeyboardFocus(KeyboardFocusChangedEventArgs)
- ButtonBase.OnLostMouseCapture(MouseEventArgs)
- ButtonBase.OnMouseEnter(MouseEventArgs)
- ButtonBase.OnMouseLeave(MouseEventArgs)
- ButtonBase.OnMouseLeftButtonDown(MouseButtonEventArgs)
- ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs)
- ButtonBase.OnMouseMove(MouseEventArgs)
- ButtonBase.OnPreviewClick(ExecuteRoutedEventArgs)
- ButtonBase.OnPropertyChanged(DependencyPropertyChangedEventArgs)
- ButtonBase.OnRenderSizeChanged(SizeChangedInfo)
- ButtonBase.OnScreenTipOpening(RoutedEventArgs)
- ButtonBase.OnTouchLeave(TouchEventArgs)
- ButtonBase.OnUnchecked()
- ButtonBase.UpdateCanExecute()
- ButtonBase.ClickMode
- ButtonBase.HasPopup
- ButtonBase.IsChecked
- ButtonBase.ImageSourceSmallSize
- ButtonBase.InputGestureText
- ButtonBase.IsEnabledCore
- ButtonBase.IsPointerOver
- ButtonBase.IsPressed
- ButtonBase.MenuItemDescription
- ButtonBase.StaysOpenOnClick
- ButtonBase.Checked
- ButtonBase.Indeterminate
- ButtonBase.Unchecked
- ControlBase.ClickEvent
- ControlBase.PreviewClickEvent
- ControlBase.ScreenTipClosingEvent
- ControlBase.ScreenTipOpeningEvent
- ControlBase.CommandProperty
- ControlBase.CommandParameterProperty
- ControlBase.CommandTargetProperty
- ControlBase.ContextProperty
- ControlBase.HasImageProperty
- ControlBase.HasLabelProperty
- ControlBase.IdProperty
- ControlBase.ImageSourceLargeProperty
- ControlBase.ImageSourceSmallProperty
- ControlBase.IsHighlightedProperty
- ControlBase.KeyTipAccessTextProperty
- ControlBase.LabelProperty
- ControlBase.ScreenTipDescriptionProperty
- ControlBase.ScreenTipFooterProperty
- ControlBase.ScreenTipHeaderProperty
- ControlBase.ScreenTipHelpUriProperty
- ControlBase.ScreenTipImageSourceProperty
- ControlBase.VariantSizeProperty
- ControlBase.OnAccessKey(AccessKeyEventArgs)
- ControlBase.OnScreenTipClosing(RoutedEventArgs)
- ControlBase.RaiseClickEvent(ExecuteRoutedEventArgs)
- ControlBase.ToString()
- ControlBase.CanUpdateCanExecuteWhenHidden
- ControlBase.Command
- ControlBase.CommandParameter
- ControlBase.CommandTarget
- ControlBase.Context
- ControlBase.HasImage
- ControlBase.HasLabel
- ControlBase.Id
- ControlBase.ImageSourceLarge
- ControlBase.ImageSourceSmall
- ControlBase.IsHighlighted
- ControlBase.KeyTipAccessText
- ControlBase.Label
- ControlBase.ScreenTipDescription
- ControlBase.ScreenTipFooter
- ControlBase.ScreenTipHeader
- ControlBase.ScreenTipHelpUri
- ControlBase.ScreenTipImageSource
- ControlBase.VariantSize
- ControlBase.Click
- ControlBase.PreviewClick
- ControlBase.ScreenTipClosing
- ControlBase.ScreenTipOpening