RadialMenu =========== Quelle : https://github.com/Julien-Marcou/RadialMenu#readme A custom control to create radial-menu into your WPF application. ![RadialMenu Demo](/Resources/RadialMenu.gif) How to use ----------- Import the RadialMenu.dll into your project (do not forget to reference it), then into your Xaml View, import the custom control xmlns:Controls="clr-namespace:RadialMenu.Controls;assembly=RadialMenu" To create the **main component** of the RadialMenu, simply type ```xaml ... ``` To create the **central menu item** of the RadialMenu, simply type ```xaml ... ``` To create a **menu item** of the RadialMenu, simply type ```xaml ... ``` Full example ----------- A tipical example of what can be done ```xaml Close New file Edit Save Delete Exit ``` which results in ![RadialMenu Example](/Resources/RadialMenuExample.png) Customization ----------- You can even create your own style of RadialMenu (do not forget to add style for `disabled`, `hovered` and `pressed` item states if desired) ```xaml ``` which results in ![RadialMenu Custom](/Resources/RadialMenuCustom.png) Advanced Usage ----------- - The radial menu will not scale by default (and transform controls will break it). To modify the size you want to adjust the Radius properties on the style. You will most likely need to adjust OuterRadius, ContentRadius, EdgeInnerRadius, EdgeOuterRadius, and ArrowRadius to resize the control - When creating RadialMenuItems try to stick the text in a TextBlock for the best formatting results - You can hide the arrow on a RadialMenuItem by setting its ArrowBackground to Transparent - To update the control from code behind after creation you cannot simply update the radialMenu.Items list, you must replace it with a new collection. For example: ```csharp MyRadialMenu.Items = new List { new RadialMenuItem { Content = new TextBlock { Text = "Hello" } }, new RadialMenuItem { Content = new TextBlock { Text = "World" } } }; ``` Multi-level menu ----------- You can easily create multi-level radial menus by using the arrow as a visual queue and then replacing the items with an updated set. For example: ```xaml ... ``` ```csharp // Main menu var MainMenuItems = new List { new RadialMenuItem { Content = new TextBlock { Text = "Item 1" }, ArrowBackground = Brushes.Transparent }, new RadialMenuItem { Content = new TextBlock { Text = "Item 2" }, ArrowBackground = Brushes.Transparent }, new RadialMenuItem { Content = new TextBlock { Text = "Sub Menu" } } }; // Sub menu var SubMenuItems = new List { new RadialMenuItem { Content = new TextBlock { Text = "Sub Item 1" }, ArrowBackground = Brushes.Transparent }, new RadialMenuItem { Content = new TextBlock { Text = "Sub Item 2" }, ArrowBackground = Brushes.Transparent }, new RadialMenuItem { Content = new TextBlock { Text = "Sub Item 3" }, ArrowBackground = Brushes.Transparent } }; // Go to Sub menu when clicking on the third item MainMenuItems[2].Click += async (sender, args) => { IsOpen = false; await Task.Delay(400); MyRadialMenu.Items = SubMenuItems; IsOpen = true; }; // Set default menu to Main menu MyRadialMenu.Items = MainMenuItems; ``` Which results in ![RadialMenu Multi-Levels]/Resources/RadialMenuMultiLevels.gif)