简体   繁体   中英

WPF Extended Toolkit DropDownButton

I'm using Extended WPF Toolkit.

How can I change standard style of arrow in this DropDownButton?

    <wpfx:DropDownButton
        Width="200"
        Height="32"
        Content="DropDownButton: ClickMe">
        <wpfx:DropDownButton.DropDownContent>
            <wpfx:WrapPanel Background="Aqua">
                <StackPanel Width="100" Height="100">
                    <Button>Click Me</Button>
                </StackPanel>
            </wpfx:WrapPanel>
        </wpfx:DropDownButton.DropDownContent>
    </wpfx:DropDownButton>

You need to modify the (entire) control template. You will find the default one here: https://github.com/xceedsoftware/wpftoolkit/blob/015d89f201800a275feacf8eccedfd58fb1a59ca/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/DropDownButton/Themes/Generic.xaml

You could copy it to your project and set the Template property of your DropDownButton :

<wpfx:DropDownButton Width="200" Height="32" Content="DropDownButton: ClickMe">
    <wpfx:DropDownButton.DropDownContent>
        <wpfx:WrapPanel Background="Aqua">
            <StackPanel Width="100" Height="100">
                <Button>Click Me</Button>
            </StackPanel>
        </wpfx:WrapPanel>
    </wpfx:DropDownButton.DropDownContent>
    <wpfx:DropDownButton.Template>
        <!-- add the ControlTemplate here -->
    </wpfx:DropDownButton.Template>
</wpfx:DropDownButton>

Look for the Path with an x:Name of "Arrow" in the template. You need to set the Data property of this to the Geometry that represents the arrow you want.

There is "Arrow" property or something that you simply can set to some enumeration value or similar. You need to define the look of the arrow yourself and modify the template.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM