Table of Contents
Drop Down Button

EO.Wpf DropDownButton offers a single control that combines a button and a DropDown control. The following sample demonstrates how to use the DropDownButton control:

<Window x:Class="Test.Window1"
        <eo:DropDownButton Width="200" HorizontalAlignment="Left">
                    <StackPanel Margin="3" Width="100">
                        <TextBlock TextWrapping="Wrap">
                    This is a sample drop down used by a DropDownButton.
            Click Me To Open The Drop Down

The above code produces the following result:

You can also use EO.Wpf DropDownService to achieve similar result. There are a few key differences between using DropDownService and DropDownButton:

  • DropDownButton automatically render itself as pressed when the drop down is open;
  • DropDownButton provides a set of "short cut" properties for the DropDown control that it uses. For example, DropDownButton provides IsDropDownOpen property for you to open or close the drop down;
  • DropDownButton allows you to use a child element, instead of the whole control as the triggering element for the drop down. The element that triggers the drop down is marked by name PART_DropDownTarget in the DropDownButton's control template. SplitButton uses this feature to "split" button so that the drop down opens only when user clicks the drop down arrow on the button.