2

任何人都可以建议如何在 WPF 中创建径向菜单,如果您提供任何示例,它会有所帮助,

4

1 回答 1

7

I highly suggest you to take a look at what I've done here

WPF RadialMenu

To sum up how it works

First, the radial menu itself :
I created a custom ContentControl RadialMenu, which can only have children of the type RadialMenuItem, then in the method ArrangeOverride of the radial menu I give to each children its Index Position in the radial menu and the Total Count of children.

Secondly, the items of the radial menu :
Each RadialMenuItem is a custom Button with a custom Template, knowing is Index Position inside the Total Count of children, the item is able to create a PieShape (with some trigonometry) for its template.

Finally, the central item of the radial menu:
The RadialMenuCentralItem is also a custom Button with a custom Template, but the Template is just an Elipse Shape, this item is placed in the radial menu, through the CentralItem Property of the radial menu.

Then with some Trigger, Animation, Binding and DependencyProperty, you will be able to do that

WPF RadialMenu

于 2015-04-21T20:52:06.377 回答