HypernovaDesktop Components · docs
Binarymission
WPFRibbon › BinaryRibbonDropDownButton

BinaryRibbonDropDownButton

class.NET 6 / 8 / 10.NET Framework 4.8Binarymission.WPF.Controls.Office

A custom menu item class that acts like a drop down button control in the ribbon window.

public class BinaryRibbonDropDownButton : MenuItem, IBinaryRibbonComponent, IBinaryRibbonContentElementBoundsConfigurable, ICommandSource, IBinaryRibbonKeyTipControl

Inherits from / implements: MenuItem, IBinaryRibbonComponent, IBinaryRibbonContentElementBoundsConfigurable, ICommandSource, IBinaryRibbonKeyTipControl

Members at a glance

BinaryRibbonDropDownButtonInitializes a new instance of the BinaryRibbonDropDownButton class.
BinaryRibbonTagGets or sets a generic tag.
ContentGets or sets the content for this control instance.
CornerRadiusGets or sets the corner radius.
DropDownFooterContentGets or sets the content of the drop-down footer.
DropDownFooterDataTemplateGets or sets the drop-down footer DataTemplate.
DropDownHeaderContentGets or sets the content of the drop-down header.
DropDownHeaderDataTemplateGets or sets the drop-down header DataTemplate.
DropDownWidthGets or sets the width of the drop-down.
IsDropDownCurrentlyPressedGets or sets a value indicating whether the drop-down is currently pressed.
LargeImageGets or sets the large image.
MaximumDropDownPanelHeightGets or sets the maximum height of the drop-down panel.
PopupAnimationGets or sets the popup animation value for this drop-down button instance.
PopupPlacementGets or sets the popup placement.
ShowDropDownImageGets or sets a value indicating whether to show drop-down image.
SmallImageGets or sets the small image.
ForcePopupActiveOnMouseUpPins the popup open, so that the mouse-up which follows the click that opened it does not immediately dismiss it.
ForcePopupInactiveReleases the pin put on the popup by ForcePopupActiveOnMouseUp, letting it close again on the next click outside.
GetContainerForItemOverrideCreates the container that one item is shown in, which for this control is a BinaryRibbonMenuItem.
IsItemItsOwnContainerOverrideReports whether an item can be shown as it stands, without being wrapped in a container of its own.
OnApplyTemplateCalled when the template's tree is generated.
OnDropDownCurrrentlyPressedChangedCalled when the button goes into or out of its pressed state, which is what opens and closes the drop-down.
OnKeyDownRaises the KeyDown event. BinaryRibbonDropDownButton overrides it so the control's own handling runs alongside the base behavior.
OnMouseLeftButtonDownRaises the MouseLeftButtonDown event. BinaryRibbonDropDownButton overrides it so the control's own handling runs alongside the base behavior.
OnMouseLeftButtonUpRaises the MouseLeftButtonUp event. BinaryRibbonDropDownButton overrides it so the control's own handling runs alongside the base behavior.
OnPopupCloseCalled when this control's drop-down popup closes. Override to react to it without having to attach to the popup yourself.
OnPopupOpenCalled when this control's drop-down popup opens. Override to react to it without having to attach to the popup yourself.
SwitchStateToggles the button between pressed and not pressed, which is how a click opens or closes the drop-down.
PopupClose/// Occurs when the drop-down popup is closed.
PopupOpenOccurs when the drop-down popup is open.
ContentPropertyContentProperty property.
CornerRadiusPropertyCornerRadiusProperty property.
DropDownFooterContentPropertyDropDownFooterContentProperty property.
DropDownFooterDataTemplatePropertyDropDownFooterDataTemplateProperty property.
DropDownHeaderContentPropertyDropDownHeaderContentProperty property.
DropDownHeaderDataTemplatePropertyDropDownHeaderDataTemplateProperty property.
DropDownWidthPropertyDropDownWidthProperty property.
IsDropDownCurrentlyPressedPropertyIsDropDownCurrentlyPressedProperty property.
LargeImagePropertyLargeImageProperty property.
MaximumDropDownPanelHeightPropertyMaximumDropDownPanelHeightProperty property.
PopupAnimationPropertyPopupAnimationProperty property.
PopupCloseEventPopupCloseEvent routed event.
PopupOpenEventPopupOpenEvent routed event.
PopupPlacementPropertyPopupPlacementProperty property.
ShowDropDownImagePropertyShowDropDownImageProperty property.
SmallImagePropertySmallImageProperty property.
popupThe popup this button drops down. It is filled in once the control template has been applied, so it is null before then.

Constructors

BinaryRibbonDropDownButton

public BinaryRibbonDropDownButton()

Initializes a new instance of the BinaryRibbonDropDownButton class.

Properties

BinaryRibbonTag

public object BinaryRibbonTag

Gets or sets a generic tag.

Value. The binary ribbon tag.

Content

public object Content

Gets or sets the content for this control instance.

CornerRadius

public CornerRadius CornerRadius

Gets or sets the corner radius.

Value. The corner radius.

DropDownFooterContent

public object DropDownFooterContent

Gets or sets the content of the drop-down footer.

DropDownFooterDataTemplate

public DataTemplate DropDownFooterDataTemplate

Gets or sets the drop-down footer DataTemplate.

DropDownHeaderContent

public object DropDownHeaderContent

Gets or sets the content of the drop-down header.

DropDownHeaderDataTemplate

public DataTemplate DropDownHeaderDataTemplate

Gets or sets the drop-down header DataTemplate.

DropDownWidth

public double DropDownWidth

Gets or sets the width of the drop-down.

IsDropDownCurrentlyPressed

public bool IsDropDownCurrentlyPressed

Gets or sets a value indicating whether the drop-down is currently pressed.

LargeImage

public ImageSource LargeImage

Gets or sets the large image.

Value. The large image.

MaximumDropDownPanelHeight

public double MaximumDropDownPanelHeight

Gets or sets the maximum height of the drop-down panel.

PopupAnimation

public PopupAnimation PopupAnimation

Gets or sets the popup animation value for this drop-down button instance.

PopupPlacement

public PlacementMode PopupPlacement

Gets or sets the popup placement.

Value. The popup placement.

ShowDropDownImage

public bool ShowDropDownImage

Gets or sets a value indicating whether to show drop-down image.

SmallImage

public ImageSource SmallImage

Gets or sets the small image.

Value. The small image.

Methods

ForcePopupActiveOnMouseUp

protected void ForcePopupActiveOnMouseUp()

Pins the popup open, so that the mouse-up which follows the click that opened it does not immediately dismiss it.

ForcePopupInactive

protected void ForcePopupInactive()

Releases the pin put on the popup by ForcePopupActiveOnMouseUp, letting it close again on the next click outside.

GetContainerForItemOverride

protected override DependencyObject GetContainerForItemOverride()

Creates the container that one item is shown in, which for this control is a BinaryRibbonMenuItem.

IsItemItsOwnContainerOverride

protected override bool IsItemItsOwnContainerOverride(object item)

Reports whether an item can be shown as it stands, without being wrapped in a container of its own.

OnApplyTemplate

public override void OnApplyTemplate()

Called when the template's tree is generated.

OnDropDownCurrrentlyPressedChanged

protected virtual void OnDropDownCurrrentlyPressedChanged(bool oldValue, bool newValue)

Called when the button goes into or out of its pressed state, which is what opens and closes the drop-down.

oldValue
The state it was in.
newValue
The state it has moved to.
The name carries a typo from the original release and is frozen for compatibility.

OnKeyDown

protected override void OnKeyDown(KeyEventArgs e)

Raises the KeyDown event. BinaryRibbonDropDownButton overrides it so the control's own handling runs alongside the base behavior.

e
The data for the event.

OnMouseLeftButtonDown

protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)

Raises the MouseLeftButtonDown event. BinaryRibbonDropDownButton overrides it so the control's own handling runs alongside the base behavior.

e
The data for the event.

OnMouseLeftButtonUp

protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e)

Raises the MouseLeftButtonUp event. BinaryRibbonDropDownButton overrides it so the control's own handling runs alongside the base behavior.

e
The data for the event.

OnPopupClose

protected virtual void OnPopupClose(object sender, EventArgs e)

Called when this control's drop-down popup closes. Override to react to it without having to attach to the popup yourself.

sender
The popup.
e
Not used.

OnPopupOpen

protected virtual void OnPopupOpen(object sender, EventArgs e)

Called when this control's drop-down popup opens. Override to react to it without having to attach to the popup yourself.

sender
The popup.
e
Not used.

SwitchState

protected virtual void SwitchState()

Toggles the button between pressed and not pressed, which is how a click opens or closes the drop-down.

Events

PopupClose

public event RoutedEventHandler PopupClose

/// Occurs when the drop-down popup is closed.

PopupOpen

public event RoutedEventHandler PopupOpen

Occurs when the drop-down popup is open.

Fields

ContentProperty

public static readonly DependencyProperty ContentProperty

ContentProperty property.

CornerRadiusProperty

public static readonly DependencyProperty CornerRadiusProperty

CornerRadiusProperty property.

DropDownFooterContentProperty

public static readonly DependencyProperty DropDownFooterContentProperty

DropDownFooterContentProperty property.

DropDownFooterDataTemplateProperty

public static readonly DependencyProperty DropDownFooterDataTemplateProperty

DropDownFooterDataTemplateProperty property.

DropDownHeaderContentProperty

public static readonly DependencyProperty DropDownHeaderContentProperty

DropDownHeaderContentProperty property.

DropDownHeaderDataTemplateProperty

public static readonly DependencyProperty DropDownHeaderDataTemplateProperty

DropDownHeaderDataTemplateProperty property.

DropDownWidthProperty

public static readonly DependencyProperty DropDownWidthProperty

DropDownWidthProperty property.

IsDropDownCurrentlyPressedProperty

public static readonly DependencyProperty IsDropDownCurrentlyPressedProperty

IsDropDownCurrentlyPressedProperty property.

LargeImageProperty

public static readonly DependencyProperty LargeImageProperty

LargeImageProperty property.

MaximumDropDownPanelHeightProperty

public static readonly DependencyProperty MaximumDropDownPanelHeightProperty

MaximumDropDownPanelHeightProperty property.

PopupAnimationProperty

public static readonly DependencyProperty PopupAnimationProperty

PopupAnimationProperty property.

PopupCloseEvent

public static readonly RoutedEvent PopupCloseEvent

PopupCloseEvent routed event.

PopupOpenEvent

public static readonly RoutedEvent PopupOpenEvent

PopupOpenEvent routed event.

PopupPlacementProperty

public static readonly DependencyProperty PopupPlacementProperty

PopupPlacementProperty property.

ShowDropDownImageProperty

public static readonly DependencyProperty ShowDropDownImageProperty

ShowDropDownImageProperty property.

SmallImageProperty

public static readonly DependencyProperty SmallImageProperty

SmallImageProperty property.

popup

protected Popup popup

The popup this button drops down. It is filled in once the control template has been applied, so it is null before then.