WPF

Code Examples Upgrade Guide User Guide Demos Support Forums Download
  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class DropDownButton

    Show / Hide Table of Contents

    Class DropDownButton

    Represents DropDownButton control.

    Inheritance
    System.Object
    RibbonItemsControl
    DropDownButton
    SplitButton
    Implements
    ICollapsable
    IRibbonControl
    System.IDisposable
    Inherited Members
    RibbonItemsControl.IconTemplateProperty
    RibbonItemsControl.IconTemplateSelectorProperty
    RibbonItemsControl.IsMultiLineProperty
    RibbonItemsControl.SplitLabelIntoTwoLineProperty
    RibbonItemsControl.LabelProperty
    RibbonItemsControl.SizeFormProperty
    RibbonItemsControl.SmallIconProperty
    RibbonItemsControl.MediumIconProperty
    RibbonItemsControl.IsSmallImageVisibleProperty
    RibbonItemsControl.LargeIconProperty
    RibbonItemsControl.IsLargeImageVisibleProperty
    RibbonItemsControl.IsDropDownOpenProperty
    RibbonItemsControl.CollapseLabelProperty
    RibbonItemsControl.IsAddInPopupProperty
    RibbonItemsControl.IconTypeProperty
    RibbonItemsControl.VectorImageProperty
    RibbonItemsControl.IconStretchProperty
    RibbonItemsControl.OnIsMultiLineChanged(DependencyPropertyChangedEventArgs)
    RibbonItemsControl.OnSplitLabelIntoTwoLineChanged(DependencyPropertyChangedEventArgs)
    RibbonItemsControl.OnLabelChanged(DependencyPropertyChangedEventArgs)
    RibbonItemsControl.CoerceOnLabel(DependencyObject, Object)
    RibbonItemsControl.CoerceOnLabel(Object)
    RibbonItemsControl.CoerceOnIsMultiline(DependencyObject, Object)
    RibbonItemsControl.CoerceOnIsMultiline(Object)
    RibbonItemsControl.OnSizeFormChanged(DependencyPropertyChangedEventArgs)
    RibbonItemsControl.OnSmallIconChanged(DependencyPropertyChangedEventArgs)
    RibbonItemsControl.OnLargeIconChanged(DependencyPropertyChangedEventArgs)
    RibbonItemsControl.FireBeforeDropDownPopup(CancelEventArgs)
    RibbonItemsControl.FireAfterDropDownPopup()
    RibbonItemsControl.Popup_Opened(Object, EventArgs)
    RibbonItemsControl.Popup_Closed(Object, EventArgs)
    RibbonItemsControl.ToggleButton_MouseLeftButtonDown(Object, MouseButtonEventArgs)
    RibbonItemsControl.OnGotMouseCapture(MouseEventArgs)
    RibbonItemsControl.OnLostMouseCapture(MouseEventArgs)
    RibbonItemsControl.OnMouseEnter(MouseEventArgs)
    RibbonItemsControl.OnMouseLeftButtonUp(MouseButtonEventArgs)
    RibbonItemsControl.OnPreviewKeyDown(KeyEventArgs)
    RibbonItemsControl.IRibbonControl.get_ToolTip()
    RibbonItemsControl.ToggleButton
    RibbonItemsControl.Popup
    RibbonItemsControl.IsMultiLine
    RibbonItemsControl.SplitLabelIntoTwoLine
    RibbonItemsControl.CollapseLabel
    RibbonItemsControl.IconTemplateSelector
    RibbonItemsControl.IconTemplate
    RibbonItemsControl.IconStretch
    RibbonItemsControl.Label
    RibbonItemsControl.SizeForm
    RibbonItemsControl.SmallIcon
    RibbonItemsControl.MediumIcon
    RibbonItemsControl.LargeIcon
    RibbonItemsControl.IsDropDownOpen
    RibbonItemsControl.IsSmallImageVisible
    RibbonItemsControl.IsLargeImageVisible
    RibbonItemsControl.IsAddInPopup
    RibbonItemsControl.VectorImage
    RibbonItemsControl.IconType
    RibbonItemsControl.LabelChanged
    RibbonItemsControl.SizeFormChanged
    RibbonItemsControl.SmallIconChanged
    RibbonItemsControl.LargeIconChanged
    RibbonItemsControl.IsDropDownOpenChanged
    RibbonItemsControl.IsMultiLineChanged
    RibbonItemsControl.SplitLabelIntoTwoLineChanged
    Namespace: Syncfusion.Windows.Tools.Controls
    Assembly: Syncfusion.Tools.Wpf.dll
    Syntax
    [SkinType(SkinVisualStyle = Skin.Office2010Black, Type = typeof(DropDownButton), XamlResource = "/Syncfusion.Tools.WPF.Classic;component/Framework/Ribbon/Themes/Office2010BlackStyle.xaml")]
    [SkinType(SkinVisualStyle = Skin.Office2010Silver, Type = typeof(DropDownButton), XamlResource = "/Syncfusion.Tools.WPF.Classic;component/Framework/Ribbon/Themes/Office2010SilverStyle.xaml")]
    [SkinType(SkinVisualStyle = Skin.ShinyBlue, Type = typeof(DropDownButton), XamlResource = "/Syncfusion.Tools.WPF.Classic;component/Framework/Ribbon/Themes/ShinyBlueStyle.xaml")]
    [SkinType(SkinVisualStyle = Skin.Office2007Blue, Type = typeof(DropDownButton), XamlResource = "/Syncfusion.Tools.WPF;component/Framework/Ribbon/Themes/Office2007BlueStyle.xaml")]
    [SkinType(SkinVisualStyle = Skin.Office2007Black, Type = typeof(DropDownButton), XamlResource = "/Syncfusion.Tools.WPF.Classic;component/Framework/Ribbon/Themes/Office2007BlackStyle.xaml")]
    [SkinType(SkinVisualStyle = Skin.Office2007Silver, Type = typeof(DropDownButton), XamlResource = "/Syncfusion.Tools.WPF.Classic;component/Framework/Ribbon/Themes/Office2007SilverStyle.xaml")]
    [SkinType(SkinVisualStyle = Skin.Office2003, Type = typeof(DropDownButton), XamlResource = "/Syncfusion.Tools.WPF.Classic;component/Framework/Ribbon/Themes/Office2003Style.xaml")]
    [SkinType(SkinVisualStyle = Skin.Blend, Type = typeof(DropDownButton), XamlResource = "/Syncfusion.Tools.WPF.Classic;component/Framework/Ribbon/Themes/BlendStyle.xaml")]
    [SkinType(SkinVisualStyle = Skin.ShinyRed, Type = typeof(DropDownButton), XamlResource = "/Syncfusion.Tools.WPF.Classic;component/Framework/Ribbon/Themes/ShinyRedStyle.xaml")]
    [SkinType(SkinVisualStyle = Skin.SyncOrange, Type = typeof(DropDownButton), XamlResource = "/Syncfusion.Tools.WPF.Classic;component/Framework/Ribbon/Themes/SyncOrangeStyle.xaml")]
    [SkinType(SkinVisualStyle = Skin.Windows8, Type = typeof(DropDownButton), XamlResource = "/Syncfusion.Tools.WPF;component/Framework/Ribbon/Themes/Windows8Style.xaml")]
    [SkinType(SkinVisualStyle = Skin.Office2010Blue, Type = typeof(DropDownButton), XamlResource = "/Syncfusion.Tools.WPF.Classic;component/Framework/Ribbon/Themes/Office2010BlueStyle.xaml")]
    [SkinType(SkinVisualStyle = Skin.VS2010, Type = typeof(DropDownButton), XamlResource = "/Syncfusion.Tools.WPF.Classic;component/Framework/Ribbon/Themes/VS2010Style.xaml")]
    [SkinType(SkinVisualStyle = Skin.Default, Type = typeof(DropDownButton), XamlResource = "/Syncfusion.Tools.WPF;component/Framework/Ribbon/Themes/Generic.xaml")]
    [SkinType(SkinVisualStyle = Skin.Metro, Type = typeof(DropDownButton), XamlResource = "/Syncfusion.Tools.WPF.Classic;component/Framework/Ribbon/Themes/MetroStyle.xaml")]
    [SkinType(SkinVisualStyle = Skin.Transparent, Type = typeof(DropDownButton), XamlResource = "/Syncfusion.Tools.WPF.Classic;component/Framework/Ribbon/Themes/TransparentStyle.xaml")]
    [SkinType(SkinVisualStyle = Skin.Office2013, Type = typeof(DropDownButton), XamlResource = "/Syncfusion.Tools.WPF.Classic;component/Framework/Ribbon/Themes/Office2013Style.xaml")]
    public class DropDownButton : RibbonItemsControl, ICollapsable, IRibbonControl, IDisposable
    Remarks

    DropDownButton class represents a control that can display child UIElements in a dropdown popup.

    Examples

    This example shows how to create a DropDownButton in XAML.

    <ribbon:DropDownButton SmallIcon="SampleImages/ChangeCase16.png">
    <ribbon:RibbonMenuItem Header="Sentence case"/>
    <ribbon:RibbonMenuItem Header="lowercase"/>
    <ribbon:RibbonMenuItem Header="UPPERCASE"/>
    <ribbon:RibbonMenuItem Header="Capitalize Each Word"/>
    <ribbon:RibbonMenuItem Header="tOOGLE cASE"/>
    </ribbon:DropDownButton>

    This example shows how to create a DropDownButton in C#.

    DropDownButton button = new DropDownButton();
    RibbonMenuItem item = new RibbonMenuItem();
    button.Items.Add(item);
    stackPanel.Children.Add(button);

    Constructors

    DropDownButton()

    Initializes a new instance of the DropDownButton class.

    Declaration
    public DropDownButton()

    Fields

    IsGroupProperty

    Defines IsGrouped dependency property.

    Declaration
    public static readonly DependencyProperty IsGroupProperty
    Field Value
    Type Description
    System.Windows.DependencyProperty

    IsPressedProperty

    Identifies when button is pressed. This is a dependency property.

    Declaration
    public static readonly DependencyProperty IsPressedProperty
    Field Value
    Type Description
    System.Windows.DependencyProperty

    IsPressedPropertyKey

    Key through which IsPressed property can be changed. This is a dependency property key.

    Declaration
    protected static readonly DependencyPropertyKey IsPressedPropertyKey
    Field Value
    Type Description
    System.Windows.DependencyPropertyKey

    PathGeometryProperty

    Defines path which is contained in toggle button. This is a dependency property.

    Declaration
    public static readonly DependencyProperty PathGeometryProperty
    Field Value
    Type Description
    System.Windows.DependencyProperty

    ToggleButtonToolTipProperty

    Defines tooltip for toggle button which is contained in large size form dropdown . This is a dependency property.

    Declaration
    public static readonly DependencyProperty ToggleButtonToolTipProperty
    Field Value
    Type Description
    System.Windows.DependencyProperty

    Properties

    IsGroup

    Gets or sets a value indicating whether the user can add child items in QAT using right click. If true, user can not add its child as QAT item. This is a dependency property.

    Declaration
    public bool IsGroup { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if this instance is group; otherwise, false.

    IsPressed

    Gets a value indicating whether this button is pressed.

    Declaration
    public bool IsPressed { get; }
    Property Value
    Type Description
    System.Boolean

    true if this instance is pressed; otherwise, false.

    PathGeometry

    Gets or sets path which is contained in toggle button.

    Declaration
    public Geometry PathGeometry { get; set; }
    Property Value
    Type Description
    System.Windows.Media.Geometry

    Type: System.Windows.Media.Geometry Geometry used in bottom part of the DropDownButton.

    ToggleButtonToolTip

    Gets or sets tooltip for toggle button which is available at bottom part of large size form.

    Declaration
    public object ToggleButtonToolTip { get; set; }
    Property Value
    Type Description
    System.Object

    Type: System.Object Object to display as a tooltip in bottom part of the DropDownButton.

    Methods

    Dispose()

    Dispose all used objects

    Declaration
    public void Dispose()

    GetContainerForItemOverride()

    Creates or identifies the element that is used to display the given item.

    Declaration
    protected override DependencyObject GetContainerForItemOverride()
    Returns
    Type Description
    System.Windows.DependencyObject

    The element that is used to display the given item.

    IsItemItsOwnContainerOverride(Object)

    Determines if the specified item is (or is eligible to be) its own container.

    Declaration
    protected override bool IsItemItsOwnContainerOverride(object item)
    Parameters
    Type Name Description
    System.Object item

    The item to check.

    Returns
    Type Description
    System.Boolean

    true if the item is (or is eligible to be) its own container; otherwise, false.

    OnApplyTemplate()

    When overridden in a derived class, is invoked whenever application code or internal processes call ApplyTemplate.

    Declaration
    public override void OnApplyTemplate()
    Overrides
    RibbonItemsControl.OnApplyTemplate()

    OnCreateAutomationPeer()

    Returns class-specific AutomationPeer implementations for the Windows Presentation Foundation infrastructure.

    Declaration
    protected override AutomationPeer OnCreateAutomationPeer()
    Returns
    Type Description
    System.Windows.Automation.Peers.AutomationPeer

    The type-specific AutomationPeer implementation.

    OnGotKeyboardFocus(KeyboardFocusChangedEventArgs)

    Invoked when an unhandled Keyboard.GotKeyboardFocus attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.

    Declaration
    protected override void OnGotKeyboardFocus(KeyboardFocusChangedEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Input.KeyboardFocusChangedEventArgs e

    The event data

    OnIsDropDownOpenChanged(DependencyPropertyChangedEventArgs)

    Invoked when DropDown open changed.

    Declaration
    protected override void OnIsDropDownOpenChanged(DependencyPropertyChangedEventArgs e)
    Parameters
    Type Name Description
    System.Windows.DependencyPropertyChangedEventArgs e

    The event data

    Overrides
    RibbonItemsControl.OnIsDropDownOpenChanged(DependencyPropertyChangedEventArgs)

    OnIsPressedChanged(DependencyPropertyChangedEventArgs)

    Updates property value cache and raises IsPressedChanged event.

    Declaration
    protected virtual void OnIsPressedChanged(DependencyPropertyChangedEventArgs e)
    Parameters
    Type Name Description
    System.Windows.DependencyPropertyChangedEventArgs e

    Property changes details, such as old value and new value.

    OnItemsChanged(NotifyCollectionChangedEventArgs)

    Invoked when the System.Windows.Controls.ItemsControl.Items property changes.

    Declaration
    protected override void OnItemsChanged(NotifyCollectionChangedEventArgs e)
    Parameters
    Type Name Description
    System.Collections.Specialized.NotifyCollectionChangedEventArgs e

    Information about the change.

    OnKeyDown(KeyEventArgs)

    Invoked when an unhandled Keyboard.KeyDown attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.

    Declaration
    protected override void OnKeyDown(KeyEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Input.KeyEventArgs e

    The event data

    Overrides
    RibbonItemsControl.OnKeyDown(KeyEventArgs)

    OnMouseLeave(MouseEventArgs)

    Provides class handling for the OnMouseLeave routed event that occurs when a mouse is released inside this element.

    Declaration
    protected override void OnMouseLeave(MouseEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Input.MouseEventArgs e

    The event data.

    OnMouseRightButtonUp(MouseButtonEventArgs)

    Invoked when an unhandled System.Windows.UIElement.MouseRightButtonUp�routed event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.

    Declaration
    protected override void OnMouseRightButtonUp(MouseButtonEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Input.MouseButtonEventArgs e

    The System.Windows.Input.MouseButtonEventArgs that contains the event data. The event data reports that the right mouse button was released.

    Overrides
    RibbonItemsControl.OnMouseRightButtonUp(MouseButtonEventArgs)

    OnPathGeometryChanged(DependencyPropertyChangedEventArgs)

    Updates property value cache and raises PathGeometryChanged event.

    Declaration
    protected virtual void OnPathGeometryChanged(DependencyPropertyChangedEventArgs e)
    Parameters
    Type Name Description
    System.Windows.DependencyPropertyChangedEventArgs e

    Property changes details, such as old value and new value.

    OnStylusSystemGesture(StylusSystemGestureEventArgs)

    Invoked when an unhandled Stylus.StylusSystemGesture attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.

    Declaration
    protected override void OnStylusSystemGesture(StylusSystemGestureEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Input.StylusSystemGestureEventArgs e

    The event data

    Overrides
    RibbonItemsControl.OnStylusSystemGesture(StylusSystemGestureEventArgs)

    OnTouchUp(TouchEventArgs)

    Provides class handling for the TouchUp routed event that occurs when a touch is released inside this element.

    Declaration
    protected override void OnTouchUp(TouchEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Input.TouchEventArgs e

    The event data

    Overrides
    RibbonItemsControl.OnTouchUp(TouchEventArgs)

    SetIsPressed(Boolean)

    Sets IsPressed dependency property.

    Declaration
    protected void SetIsPressed(bool pressed)
    Parameters
    Type Name Description
    System.Boolean pressed

    Value which should be set.

    Events

    IsPressedChanged

    Event that is raised when IsPressed property is changed.

    Declaration
    public event PropertyChangedCallback IsPressedChanged
    Event Type
    Type Description
    System.Windows.PropertyChangedCallback

    PathGeometryChanged

    Event that is raised when PathGeometry property is changed.

    Declaration
    public event PropertyChangedCallback PathGeometryChanged
    Event Type
    Type Description
    System.Windows.PropertyChangedCallback

    Implements

    ICollapsable
    IRibbonControl
    System.IDisposable
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved