ButtonAdv


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



XAML


∇   xaml←ButtonAdvXAML
⍝ XAML for the ButtonAdv 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:ButtonAdv Name="btnAdv" Label="Howdy">'
 xaml,←⊂'        </sftools:ButtonAdv>'
 xaml,←⊂'    </StackPanel>'
 xaml,←⊂'</Window>' 


Code


∇ ButtonAdv;⎕IO;⎕ML;xaml
⍝ Simple ButtonAdv example
 ⎕IO ⎕ML←0 3
 xaml←ButtonAdvXAML
 #.window←#.UTIL.WPF.LoadXaml xaml(⊂'SyncTools')
 window_btnAdv←#.window.FindName⊂'btnAdv'
 window_btnAdv.onClick←'#.ButtonAdv.Howdy'
 #.window.Show


∇ Howdy w;⎕IO;⎕ML
⍝ Callback for Click on the ButtonAdv control
 ⎕IO ⎕ML←0 3
 ⎕←'Howdy to you too'


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

'Syncfusion.Windows.Shared,Syncfusion/4.5/Syncfusion.Shared.WPF.dll'
'SyncFusion.Windows.Tools.Controls,Syncfusion/4.5/Syncfusion.Tools.WPF.dll

 to the ⎕USING list of
LoadXAML

At this level there's no obvious advantage over WPF's native Button except that the default icon is a bit intrusive; to keep the sample code self-contained I've omitted any icon properties (they need to reference an image file - SyncFusion's documentation in this instance should be obvious enough).  Where ButtonAdv seems to have the edge is that it avoids the tedium of creating buttons with both labels and images, and the options for sizing (again, see the SyncFusion documentation).

Operation


      #.ButtonAdv.ButtonAdv

Unresolved Issues


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