PopupButton Class
Represents a button Ribbon control that displays a popup when clicked.
public class PopupButton : PopupButtonBase, IKeyTipTarget, ILogicalParent, IVariantControl
- Inheritance:
- object Visual UIElement FrameworkElement Control ControlBase ButtonBase PopupButtonBase object
- Derived:
- ApplicationButton PopupGalleryFilterButton QuickAccessToolBarCustomizeButton QuickAccessToolBarOverflowButton RibbonGalleryPopupButton
- Implements:
- IKeyTipTarget ILogicalParent IVariantControl
Remarks
For detailed documentation on this control's features and how to use them, please see the PopupButton documentation topic.
Constructors
PopupButton()
Initializes an instance of the class.
public PopupButton()
Methods
OnClick(ExecuteRoutedEventArgs)
Called when the control is clicked and a Click event is raised
protected override void OnClick(ExecuteRoutedEventArgs e)
Parameter | Type | Description |
---|---|---|
e | ExecuteRoutedEventArgs | An |
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. |
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. |
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.
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. |
OnPopupClosed()
Raises the PopupClosed event.
protected override void OnPopupClosed()
OnPreviewClick(ExecuteRoutedEventArgs)
Raises the PreviewClick event.
protected override void OnPreviewClick(ExecuteRoutedEventArgs e)
Parameter | Type | Description |
---|---|---|
e | ExecuteRoutedEventArgs | An |
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. |
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()
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.OnCommandChanged(ICommand, ICommand)
- ButtonBase.OnCreateAutomationPeer()
- ButtonBase.OnIndeterminate()
- ButtonBase.OnKeyDown(KeyEventArgs)
- ButtonBase.OnKeyUp(KeyEventArgs)
- ButtonBase.OnLostKeyboardFocus(KeyboardFocusChangedEventArgs)
- ButtonBase.OnMouseEnter(MouseEventArgs)
- ButtonBase.OnMouseLeave(MouseEventArgs)
- ButtonBase.OnMouseMove(MouseEventArgs)
- ButtonBase.OnRenderSizeChanged(SizeChangedInfo)
- ButtonBase.OnScreenTipOpening(RoutedEventArgs)
- ButtonBase.OnTouchLeave(TouchEventArgs)
- ButtonBase.OnUnchecked()
- 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.CoerceCommandParameter(DependencyObject, object)
- 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