PopupButtonBase Class
Represents a base class for a button Ribbon control that can display a popup.
[TemplatePart(Name = "PART_Popup", Type = typeof(Popup))]
[TemplatePart(Name = "PART_ResizeGrip", Type = typeof(Thumb))]
public abstract class PopupButtonBase : ButtonBase, IKeyTipTarget, ILogicalParent, IVariantControl
- Inheritance:
- object Visual UIElement FrameworkElement Control ControlBase ButtonBase object
- Derived:
- PopupButton SplitButton
- Implements:
- IKeyTipTarget ILogicalParent IVariantControl
Constructors
PopupButtonBase()
Initializes an instance of the class.
protected PopupButtonBase()
Properties
AutoDisableWhenPopupContentIsDisabled
Gets or sets whether to auto-disable the popup button when all the items on the PopupContent are disabled.
public bool AutoDisableWhenPopupContentIsDisabled { get; set; }
Property Value
- bool:
trueif auto-disabling should occur; otherwise,false. The default value istrue.
CustomPopupPlacementCallback
Gets or sets a delegate handler method that positions the popup control.
[Bindable(false)]
public CustomPopupPlacementCallback CustomPopupPlacementCallback { get; set; }
Property Value
- CustomPopupPlacementCallback:
The CustomPopupPlacementCallback delegate method that provides placement information for the popup control. The default value is
null.
IsPopupOpen
Gets or sets whether a child popup is open.
public bool IsPopupOpen { get; set; }
Property Value
- bool:
trueif the a child popup is open; otherwise,false.
LogicalChildren
Gets an enumerator for logical child elements of this element.
protected override IEnumerator LogicalChildren { get; }
Property Value
- IEnumerator:
An enumerator for logical child elements of this element.
PopupContent
Gets or sets the content that is displayed on the popup for the button.
public object PopupContent { get; set; }
Property Value
- object:
The content that is displayed on the popup for the button.
Remarks
This can be any object, including panels of multiple controls, however it is generally a Menu.
PopupContentTemplate
Gets or sets the DataTemplate to use for the PopupContent.
public DataTemplate PopupContentTemplate { get; set; }
Property Value
- DataTemplate:
The DataTemplate to use for the PopupContent.
Remarks
This property is only really useful if your popup content is a data object and not a UI element.
PopupContentTemplateSelector
Gets or sets the DataTemplateSelector to use for the PopupContent.
public DataTemplateSelector PopupContentTemplateSelector { get; set; }
Property Value
- DataTemplateSelector:
The DataTemplateSelector to use for the PopupContent.
Remarks
This property is only really useful if your popup content is a data object and not a UI element.
PopupHasBorder
Gets or sets whether the popup should display a border.
public bool PopupHasBorder { get; set; }
Property Value
- bool:
trueif the popup should display a border; otherwise,false. The default value istrue.
PopupHorizontalOffset
Gets or sets the offset from the left of the area that is specified for the popup control content by a combination of the PopupPlacement, PopupPlacementTarget, and PopupPlacementRectangle properties.
[TypeConverter(typeof(LengthConverter))]
public double PopupHorizontalOffset { get; set; }
Property Value
- double:
An offset from the left of the area that is specified for the popup control by a combination of the PopupPlacement, PopupPlacementTarget, and PopupPlacementRectangle properties. The default value is
0.0.
PopupPlacement
Gets or sets the orientation of the popup when the it opens, and specifies the behavior of the popup when it overlaps screen boundaries.
public PlacementMode PopupPlacement { get; set; }
Property Value
- PlacementMode:
A PlacementMode enumeration value that determines the orientation of the popup when it opens, and that specifies how it interacts with screen boundaries. The default value is
Bottom.
PopupPlacementRectangle
Gets or sets the rectangle relative to which the popup control is positioned when it opens.
public Rect PopupPlacementRectangle { get; set; }
Property Value
- Rect:
The rectangle that is used to position the popup control. The default value is
null.
PopupPlacementTarget
Gets or sets the element relative to which the popup is positioned when it opens.
public UIElement PopupPlacementTarget { get; set; }
Property Value
PopupResizeMode
Gets or sets a ControlResizeMode that specifies the popup's resizing capabilities.
public ControlResizeMode PopupResizeMode { get; set; }
Property Value
- ControlResizeMode:
A ControlResizeMode that specifies the popup's resizing capabilities. The default value is
ControlResizeMode.None.
PopupVerticalOffset
Gets or sets the offset from the top of the area that is specified for the popup control content by a combination of the PopupPlacement, PopupPlacementTarget, and PopupPlacementRectangle properties.
[TypeConverter(typeof(LengthConverter))]
public double PopupVerticalOffset { get; set; }
Property Value
- double:
An offset from the top of the area that is specified for the popup control by a combination of the PopupPlacement, PopupPlacementTarget, and PopupPlacementRectangle properties. The default value is
0.0.
Methods
OnLostMouseCapture(MouseEventArgs)
Called when an element no longer is receiving mouse event messages.
protected override void OnLostMouseCapture(MouseEventArgs e)
| Parameter | Type | Description |
|---|---|---|
| e | MouseEventArgs | The event data for the |
OnPopupClosed()
Raises the PopupClosedEvent.
protected virtual void OnPopupClosed()
OnPopupOpened()
Raises the PopupOpenedEvent.
protected virtual void OnPopupOpened()
OnPopupOpening()
Raises the PopupOpeningEvent.
protected virtual bool OnPopupOpening()
Returns
- bool:
trueif the popup opening should be allowed to open; otherwise,false.
OnVisualParentChanged(DependencyObject)
Invoked when the parent of the element in the visual tree has changed.
protected override void OnVisualParentChanged(DependencyObject oldParent)
| Parameter | Type | Description |
|---|---|---|
| oldParent | DependencyObject | A System.Windows.DependencyObject that indicates the old visual parent. |
Events
PopupClosed
Occurs when the value of the IsPopupOpen property changes from true to false.
PopupOpened
Occurs when the value of the IsPopupOpen property changes from false to true.
PopupOpening
Occurs before the value of the IsPopupOpen property changes from false to true.
public event EventHandler<CancelRoutedEventArgs> PopupOpening
Event Type
Fields
AutoDisableWhenPopupContentIsDisabledProperty
Identifies the AutoDisableWhenPopupContentIsDisabled dependency property. This field is read-only.
public static readonly DependencyProperty AutoDisableWhenPopupContentIsDisabledProperty
CustomPopupPlacementCallbackProperty
Identifies the CustomPopupPlacementCallback dependency property. This field is read-only.
public static readonly DependencyProperty CustomPopupPlacementCallbackProperty
IsPopupOpenProperty
Identifies the IsPopupOpen dependency property. This field is read-only.
public static readonly DependencyProperty IsPopupOpenProperty
PopupClosedEvent
Identifies the PopupClosed routed event. This field is read-only.
public static readonly RoutedEvent PopupClosedEvent
PopupContentProperty
Identifies the PopupContent dependency property. This field is read-only.
public static readonly DependencyProperty PopupContentProperty
PopupContentTemplateProperty
Identifies the PopupContentTemplate dependency property. This field is read-only.
public static readonly DependencyProperty PopupContentTemplateProperty
PopupContentTemplateSelectorProperty
Identifies the PopupContentTemplateSelector dependency property. This field is read-only.
public static readonly DependencyProperty PopupContentTemplateSelectorProperty
PopupHasBorderProperty
Identifies the PopupHasBorder dependency property. This field is read-only.
public static readonly DependencyProperty PopupHasBorderProperty
PopupHorizontalOffsetProperty
Identifies the PopupHorizontalOffset dependency property. This field is read-only.
public static readonly DependencyProperty PopupHorizontalOffsetProperty
PopupOpenedEvent
Identifies the PopupOpened routed event. This field is read-only.
public static readonly RoutedEvent PopupOpenedEvent
PopupOpeningEvent
Identifies the PopupOpening routed event. This field is read-only.
public static readonly RoutedEvent PopupOpeningEvent
PopupPlacementProperty
Identifies the PopupPlacement dependency property. This field is read-only.
public static readonly DependencyProperty PopupPlacementProperty
PopupPlacementRectangleProperty
Identifies the PopupPlacementRectangle dependency property. This field is read-only.
public static readonly DependencyProperty PopupPlacementRectangleProperty
PopupPlacementTargetProperty
Identifies the PopupPlacementTarget dependency property. This field is read-only.
public static readonly DependencyProperty PopupPlacementTargetProperty
PopupResizeModeProperty
Identifies the PopupResizeMode dependency property. This field is read-only.
public static readonly DependencyProperty PopupResizeModeProperty
PopupVerticalOffsetProperty
Identifies the PopupVerticalOffset dependency property. This field is read-only.
public static readonly DependencyProperty PopupVerticalOffsetProperty
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.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.CoerceCommandParameter(DependencyObject, object)
- ControlBase.OnAccessKey(AccessKeyEventArgs)
- ControlBase.OnContextChanged(ControlContext, ControlContext)
- ControlBase.OnKeyTipAccessed(string)
- ControlBase.OnScreenTipClosing(RoutedEventArgs)
- ControlBase.OnVariantSizeChanged(VariantSize, VariantSize)
- 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