TreeViewAdv


Display a Window containing a TreeViewAdv defined by the data argument (this is a mutation of Syncfusion's own sample code and shown here partially expanded)



XAML


∇  xaml←TreeViewAdvXAML workers;worker;entry
⍝ XAML for the TreeViewAdv 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:local="clr-namespace:Syncfusion.Windows.Tools.Controls;assembly=Syncfusion.Tools.WPF"'
 xaml,←⊂'  Title="TreeViewAdv Example" Height="200" Width="250">'
 xaml,←⊂'  <Grid>'
 xaml,←⊂'    <local:TreeViewAdv>'
 :For worker :In workers
     xaml,←⊂'      <local:TreeViewItemAdv Header="',(↑worker),'">'
     :For entry :In 1⊃worker
         xaml,←⊂'        <local:TreeViewItemAdv Header="',entry,'"/>'
     :EndFor
     xaml,←⊂'      </local:TreeViewItemAdv>'
 :EndFor
 xaml,←⊂'    </local:TreeViewAdv>'
 xaml,←⊂'  </Grid>'
 xaml,←⊂'</Window>' 

Code


∇  TreeViewAdv w;⎕IO;⎕ML;⎕USING;xaml
⍝ Simple TreeViewAdv example
 ⎕IO ⎕ML←0 3
 xaml←TreeViewAdvXAML w
 window←#.UTIL.WPF.LoadXaml xaml(⊂'SyncTools')
 {}window.ShowDialog


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

    'Syncfusion.tools.wpf,Syncfusion.tools.wpf.dll'

 to the ⎕USING list of LoadXAML


Note - defining the window by building XAML from the data isn't usually the smartest thing to do, but it's possible and may suit some scenarios.

Operation

      #.TreeViewAdv.employees←('Boss' ('Jesper' 'Aaberg' '12345'))('Worker' ('Dominik' 'Paiha' '98765'))
      #.TreeViewAdv.TreeViewAdv #.TreeViewAdv.employees


Unresolved Issues