PercentTextBox


Display a Window containing a SyncFusion PercentTextBox, prefilled and retrieving the (new) value when the user closes the Window.



XAML


∇ xaml←PercentTextBoxXAML
⍝ XAML for the PercentTextBox 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.Shared;assembly=SyncFusion.Shared.WPF"'
 xaml,←⊂'    SizeToContent="WidthandHeight" >'
 xaml,←⊂'    <StackPanel>'
 xaml,←⊂'        <sftools:PercentTextBox Name="pctbox"/>'
 xaml,←⊂'    </StackPanel>'
 xaml,←⊂'</Window>'


Code


∇ z←PercentTextBox w;⎕IO;⎕ML;xaml;⎕USING
⍝ Simple PercentTextBox example
 ⎕IO ⎕ML←0 3
 ⎕USING←,⊂'System'
 xaml←PercentTextBoxXAML
 #.window←#.UTIL.WPF.LoadXaml xaml(⊂'SyncTools')
 window_pctbox←#.window.FindName⊂'pctbox'
 window_pctbox.PercentValue←w
 {}#.window.ShowDialog
 z←window_pctbox.PercentValue


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

Interesting to note the simplicity here (aside from the "unique" PercentValue property name when compared to the conceptually-similar IntegerTextBox (no need here for the pantomime System.Convert hocuspocus).

Operation


       #.PercentTextBox.PercentTextBox 33    
33

Unresolved Issues


Exploring other properties and associated behaviours.