Display a Window containing a MenuAdv and respond to the user clicking on it


∇  xaml←MenuAdvXAML
⍝ XAML for the MenuAdv example
 xaml,←⊂'   xmlns=""'
 xaml,←⊂'   xmlns:x=""'
 xaml,←⊂'   xmlns:sftools="clr-namespace:Syncfusion.Windows.Shared;assembly=Syncfusion.Shared.WPF"'
 xaml,←⊂'   Height="100" Width="300" > '
 xaml,←⊂'   <Grid>'
 xaml,←⊂'       <sftools:MenuAdv>'
 xaml,←⊂'         <sftools:MenuItemAdv Header="Fish" Name="mniFish"/>'
 xaml,←⊂'         <sftools:MenuItemAdv Header="Meat">'
 xaml,←⊂'           <sftools:MenuItemAdv Header="Beef" Name="mniBeef"/>'
 xaml,←⊂'           <sftools:MenuItemAdv Header="Pork" Name="mniPork"/>'
 xaml,←⊂'         </sftools:MenuItemAdv>'
 xaml,←⊂'       </sftools:MenuAdv>'
 xaml,←⊂'   </Grid>'


∇ MenuAdv;⎕IO;⎕ML
⍝ Simple MenuAdv example
 ⎕IO ⎕ML←0 3
 #.window←#.UTIL.WPF.LoadXaml xaml(⊂'SyncTools')
 window_mnifish window_mnibeef window_mnipork←{#.window.FindName⊂⍵}¨'mniFish' 'mniBeef' 'mniPork'
 (window_mnifish window_mnibeef window_mnipork).onClick←⊂'#.MenuAdv.Pick'

∇ Pick w;⎕IO;⎕ML
⍝ Callabck for a MenuAdv control
 ⎕IO ⎕ML←0 3
 ⎕←'You clicked on <',((↑w).Name),'>'

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


 to the ⎕USING list of

Notice that everything within a MenuAdv seems to have to be a MenuItemAdv, with nesting (the <Meat> submenu) arising by nesting the definitions - which differs (if I recall correctly) the Dyalog Native approach of menus within menus (menuitem appearing only at the end of the chain).


You clicked on <mniBeef>
You clicked on <mniPork>
You clicked on <mniFish>

Unresolved Issues

Nothing springing to mind at the moment - pending some use of this within applications.