Display a Window containing a GroupBar with a simple hierarchy of items, show a silly message when the user clicks on one of the items.


∇ xaml←GroupBarXAML;⎕IO;⎕ML
⍝ XAML for the GroupBar example
 ⎕IO ⎕ML←0 3
 xaml,←⊂'    xmlns=""'
 xaml,←⊂'    xmlns:x=""'
 xaml,←⊂'    xmlns:sftools="clr-namespace:Syncfusion.Windows.Tools.Controls;assembly=SyncFusion.Tools.WPF"'
 xaml,←⊂'    SizeToContent="WidthandHeight">'
 xaml,←⊂'    <StackPanel>'
 xaml,←⊂'          <sftools:GroupBar Name="gb" Height="200">'
 xaml,←⊂'           <sftools:GroupBarItem Header="ItemA">'
 xaml,←⊂'              <sftools:GroupView Width="200">'
 xaml,←⊂'                <sftools:GroupViewItem Text="ViewA" Name="gviA"/>'
 xaml,←⊂'                <sftools:GroupViewItem Text="ViewB" Name="gviB"/>'
 xaml,←⊂'              </sftools:GroupView>'
 xaml,←⊂'           </sftools:GroupBarItem>'
 xaml,←⊂'           <sftools:GroupBarItem Header="ItemB"/>'
 xaml,←⊂'           <sftools:GroupBarItem Header="ItemC"/>'
 xaml,←⊂'        </sftools:GroupBar>'
 xaml,←⊂'    </StackPanel>'


∇  GroupBar;⎕IO;⎕ML;xaml
⍝ Simple GroupBar example
 ⎕IO ⎕ML←0 3
 window←#.UTIL.WPF.LoadXaml xaml(⊂'SyncTools')
 window_gviA window_gviB←{window.FindName⊂⍵}¨'gviA' 'gviB'
 (window_gviA window_gviB).onClick←⊂'GroupBarYellow'

 GroupBarYellow w;⎕IO;⎕ML
⍝ Simple callback on GroupViewItem
 ⎕IO ⎕ML←0 3
 ⎕←'Ow, you clickeded ',(↑w).Name

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


 to the ⎕USING list of LoadXAML

A couple of idiosyncracies here - notice the explicit Height and Width settings, you need to do these to give the control room to do its visual thing properly (try tweaking the code above and you'll see).
Also, unlike Button (for example) repeated clicking on the same GroupViewItem won't get the callback more than once, you have to click different things - I've no idea...


       #. #.GroupBar.GroupBar        
Ow, you clickeded gviA
Ow, you clickeded gviB
Ow, you clickeded gviA
Ow, you clickeded gviB

Unresolved Issues