ToolBarAdv


Display a Window containing a ToolBarAdv and respond to the user clicking either of the two buttons it contains



XAML


∇  xaml←ToolBarAdvXAML
⍝ XAML for the ToolBarAdv 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.Tools.Controls;assembly=SyncFusion.Shared.WPF"'
 xaml,←⊂'    SizeToContent="WidthandHeight" >'
 xaml,←⊂'    <StackPanel>'
 xaml,←⊂'        <sftools:ToolBarAdv >'
 xaml,←⊂'          <Button Content="BtnA" Name="btnA"/>'
 xaml,←⊂'          <Button Content="BtnB" Name="btnB"/>'
 xaml,←⊂'        </sftools:ToolBarAdv>'
 xaml,←⊂'    </StackPanel>'
 xaml,←⊂'</Window>'


Code


∇  ToolBarAdv;⎕IO;⎕ML;xaml
⍝ Simple ToolBarAdv example
 ⎕IO ⎕ML←0 3
 xaml←ToolBarAdvXAML
 window←#.UTIL.WPF.LoadXaml xaml(⊂'SyncTools')
 window_btnA window_btnB←{window.FindName⊂⍵}¨'btnA' 'btnB'
 (window_btnA window_btnB).onClick←⊂'#.ToolBarAdv.Howdy'
 window.Show


∇  Howdy w;⎕IO;⎕ML
⍝ Callback for button presses
 ⎕IO ⎕ML←0 3
 ⎕←'You pressed ',(↑w).Name


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

'Syncfusion.Windows.Shared,Syncfusion/4.5/Syncfusion.Shared.WPF.dll'

 to the ⎕USING list of
LoadXAML

At this level it's not clear what advantages this might have over the Microsoft .NET ToolBar control (the obvious downside is that it embeds dependency on Syncfusion ever deeper into application code).

Operation


       #.ToolBarAdv.ToolBarAdv    
You pressed btnA
You pressed btnA
You pressed btnB

Unresolved Issues


Explore more properties