RadialMenu


Display a Window containing a RadialMenu, and - like a bad waiter - tell the user what they've chosen...



XAML


∇  xaml←RadialMenuXAML
⍝ XAML for the RadialMenu example
 xaml←⊂'<Window'
 xaml,←⊂'    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"'
 xaml,←⊂'    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"'
 xaml,←⊂'    xmlns:sftools="clr-namespace:Syncfusion.Windows.Controls.Navigation;assembly=SyncFusion.SfRadialMenu.Wpf"'
 xaml,←⊂'    SizeToContent="Height" Width="400">'
 xaml,←⊂'    <StackPanel>'
 xaml,←⊂'        <sftools:SfRadialMenu>'
 xaml,←⊂'          <sftools:SfRadialMenuItem Header="Soups" Name="rmnuSoup"/>'
 xaml,←⊂'          <sftools:SfRadialMenuItem Header="Mains" Name="rmnuMain" />'
 xaml,←⊂'          <sftools:SfRadialMenuItem Header="Puddings"  Name="rmnuPud"/>'
 xaml,←⊂'          <sftools:SfRadialMenuItem Header="Drinks" Name="rmnuDrink" />'
 xaml,←⊂'        </sftools:SfRadialMenu>'
 xaml,←⊂'    </StackPanel>'
 xaml,←⊂'</Window>'


Code


∇  z←RadialMenu w;⎕IO;⎕ML;xaml
⍝ Simple RadialMenu example
 ⎕IO ⎕ML←0 3
 xaml←RadialMenuXAML
 w←#.UTIL.WPF.LoadXaml xaml(⊂'SyncTools')
 w_rmnuSoup w_rmnuMain w_rmnuPud w_rmnuDrink←{w.FindName⊂⍵}¨'rmnuSoup' 'rmnuMain' 'rmnuPud' 'rmnuDrink'
 (w_rmnuSoup w_rmnuMain w_rmnuPud w_rmnuDrink).onClick←⊂'YouWanna'
 {}w.ShowDialog


∇ YouWanna w
⍝ Callback for RadialMenu items
 ⎕←'YouWanna ',(↑w).Header


The 'SyncTools' argument to #.UTIL.LoadXAML has the effect of adding

'Syncfusion.SfRadialMenu.WPF,Syncfusion/4.5/Syncfusion.SfRadialMenu.WPF.dll'

 to the ⎕USING list of
LoadXAML

Operation


#.RadialMenu.RadialMenu ⍬       
    YouWanna Soups
    YouWanna Mains
    YouWanna Puddings
    YouWanna Drinks

Note that the menu is initially displayed collapsed, click on the central button to expand it.

Unresolved Issues


Are there other properties which might be useful?