SplitButton Class
Represents a split button Ribbon control that is capable of displaying a menu.
[TemplatePart(Name = "PART_Button", Type = typeof(UIElement))]
public class SplitButton : PopupButtonBase, IKeyTipTarget, ILogicalParent, IVariantControl
- Inheritance:
- object Visual UIElement FrameworkElement Control ControlBase ButtonBase PopupButtonBase object
- Implements:
- IKeyTipTarget ILogicalParent IVariantControl
Remarks
For detailed documentation on this control's features and how to use them, please see the SplitButton documentation topic.
Constructors
SplitButton()
Initializes an instance of the SplitButton
class.
public SplitButton()
SplitButton(ICommand)
Initializes an instance of the SplitButton
class.
public SplitButton(ICommand command)
Parameter | Type | Description |
---|---|---|
command | ICommand | The ICommand to assign to the button. |
Properties
IsButtonEnabled
Gets whether the button is enabled.
public bool IsButtonEnabled { get; }
Property Value
- bool:
true
if the button is enabled; otherwise,false
.
IsButtonHighlighted
Gets whether the button is highlighted.
public bool IsButtonHighlighted { get; }
Property Value
- bool:
true
if the button is highlighted; otherwise,false
.
IsEnabledCore
Gets a value that becomes the return value of IsEnabled in derived classes.
protected override bool IsEnabledCore { get; }
Property Value
- bool:
true
if the element is enabled; otherwise,false
.
IsPopupButtonEnabled
Gets whether the popup button is enabled.
public bool IsPopupButtonEnabled { get; }
Property Value
- bool:
true
if the popup button is enabled; otherwise,false
.
PopupCommand
Gets or sets the ICommand that is attached to the control, and is fired when the popup portion of the split button is clicked.
public ICommand PopupCommand { get; set; }
Property Value
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. |
OnCreateAutomationPeer()
Creates and returns an AutomationPeer object for this type.
protected override AutomationPeer OnCreateAutomationPeer()
Returns
- AutomationPeer:
The AutomationPeer that was created.
OnIsKeyboardFocusWithinChanged(DependencyPropertyChangedEventArgs)
Called after the value of the IsKeyboardFocusWithin property has changed.
protected override void OnIsKeyboardFocusWithinChanged(DependencyPropertyChangedEventArgs e)
Parameter | Type | Description |
---|---|---|
e | DependencyPropertyChangedEventArgs | A System.Windows.DependencyPropertyChangedEventArgs that contains the event data. |
OnKeyDown(KeyEventArgs)
Invoked when an unhandled Keyboard.KeyDownEvent attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
protected override void OnKeyDown(KeyEventArgs e)
Parameter | Type | Description |
---|---|---|
e | KeyEventArgs | A KeyEventArgs that contains the event data. |
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.
OnKeyUp(KeyEventArgs)
Invoked when an unhandled Keyboard.KeyUpEvent attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
protected override void OnKeyUp(KeyEventArgs e)
Parameter | Type | Description |
---|---|---|
e | KeyEventArgs | A KeyEventArgs that contains the event data. |
OnMouseLeave(MouseEventArgs)
Occurs when the mouse leaves the control.
protected override void OnMouseLeave(MouseEventArgs e)
Parameter | Type | Description |
---|---|---|
e | MouseEventArgs | A MouseEventArgs that contains the event data. |
OnMouseLeftButtonDown(MouseButtonEventArgs)
Invoked when an unhandled MouseLeftButtonDown routed event is raised on this element. Implement this method to add class handling for this event.
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
Parameter | Type | Description |
---|---|---|
e | MouseButtonEventArgs | The event data for the MouseLeftButtonDown event. |
OnMouseLeftButtonUp(MouseButtonEventArgs)
Invoked when an unhandled MouseLeftButtonUp routed event is raised on this element. Implement this method to add class handling for this event.
protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e)
Parameter | Type | Description |
---|---|---|
e | MouseButtonEventArgs | The event data for the MouseLeftButtonUp event. |
OnMouseMove(MouseEventArgs)
Invoked when an unhandled Mouse.MouseMoveEvent attached event is raised on this element. Implement this method to add class handling for this event.
protected override void OnMouseMove(MouseEventArgs e)
Parameter | Type | Description |
---|---|---|
e | MouseEventArgs | A MouseEventArgs that contains the event data. |
OnPopupClosed()
Raises the PopupClosed event.
protected override void OnPopupClosed()
OnPropertyChanged(DependencyPropertyChangedEventArgs)
Invoked whenever the effective value of any dependency property on this FrameworkElement has been updated. The specific dependency property that changed is reported in the arguments parameter.
protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e)
Parameter | Type | Description |
---|---|---|
e | DependencyPropertyChangedEventArgs | The event data that describes the property that changed, as well as old and new values. |
OnTouchLeave(TouchEventArgs)
Occurs when the touch device leaves the control.
protected override void OnTouchLeave(TouchEventArgs e)
Parameter | Type | Description |
---|---|---|
e | TouchEventArgs | A TouchEventArgs that contains the event data. |
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. |
UpdateCanExecute()
Updates whether the command can execute.
protected override void UpdateCanExecute()
Fields
IsButtonEnabledProperty
Identifies the IsButtonEnabled dependency property. This field is read-only.
public static readonly DependencyProperty IsButtonEnabledProperty
IsButtonHighlightedProperty
Identifies the IsButtonHighlighted dependency property. This field is read-only.
public static readonly DependencyProperty IsButtonHighlightedProperty
IsPopupButtonEnabledProperty
Identifies the IsPopupButtonEnabled dependency property. This field is read-only.
public static readonly DependencyProperty IsPopupButtonEnabledProperty
PopupCommandProperty
Identifies the PopupCommand
dependency property. This field is read-only.
public static readonly DependencyProperty PopupCommandProperty
Inherited Members
- PopupButtonBase.PopupClosedEvent
- PopupButtonBase.PopupOpenedEvent
- PopupButtonBase.PopupOpeningEvent
- PopupButtonBase.AutoDisableWhenPopupContentIsDisabledProperty
- PopupButtonBase.CustomPopupPlacementCallbackProperty
- PopupButtonBase.IsPopupOpenProperty
- PopupButtonBase.PopupContentProperty
- PopupButtonBase.PopupContentTemplateProperty
- PopupButtonBase.PopupContentTemplateSelectorProperty
- PopupButtonBase.PopupHasBorderProperty
- PopupButtonBase.PopupHorizontalOffsetProperty
- PopupButtonBase.PopupPlacementProperty
- PopupButtonBase.PopupPlacementRectangleProperty
- PopupButtonBase.PopupPlacementTargetProperty
- PopupButtonBase.PopupResizeModeProperty
- PopupButtonBase.PopupVerticalOffsetProperty
- PopupButtonBase.OnLostMouseCapture(MouseEventArgs)
- PopupButtonBase.OnPopupOpened()
- PopupButtonBase.OnPopupOpening()
- PopupButtonBase.OnVisualParentChanged(DependencyObject)
- PopupButtonBase.AutoDisableWhenPopupContentIsDisabled
- PopupButtonBase.CustomPopupPlacementCallback
- PopupButtonBase.IsPopupOpen
- PopupButtonBase.LogicalChildren
- PopupButtonBase.PopupContent
- PopupButtonBase.PopupContentTemplate
- PopupButtonBase.PopupContentTemplateSelector
- PopupButtonBase.PopupHasBorder
- PopupButtonBase.PopupHorizontalOffset
- PopupButtonBase.PopupPlacement
- PopupButtonBase.PopupPlacementRectangle
- PopupButtonBase.PopupPlacementTarget
- PopupButtonBase.PopupResizeMode
- PopupButtonBase.PopupVerticalOffset
- PopupButtonBase.PopupClosed
- PopupButtonBase.PopupOpened
- PopupButtonBase.PopupOpening
- 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.OnIndeterminate()
- ButtonBase.OnLostKeyboardFocus(KeyboardFocusChangedEventArgs)
- ButtonBase.OnMouseEnter(MouseEventArgs)
- ButtonBase.OnPreviewClick(ExecuteRoutedEventArgs)
- ButtonBase.OnRenderSizeChanged(SizeChangedInfo)
- ButtonBase.OnScreenTipOpening(RoutedEventArgs)
- ButtonBase.OnUnchecked()
- ButtonBase.ClickMode
- ButtonBase.HasPopup
- ButtonBase.IsChecked
- ButtonBase.ImageSourceSmallSize
- ButtonBase.InputGestureText
- 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