Calculator


Display a Window containing a Calculator, return the calculated value when the window is closed



XAML


∇  xaml←CalculatorXAML
⍝ XAML for the Calculator 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.Controls.Input;assembly=SyncFusion.SfInput.WPF"'
 xaml,←⊂'    SizeToContent="WidthandHeight" >'
 xaml,←⊂'    <StackPanel>'
 xaml,←⊂'        <sftools:SfCalculator Name="calc">'
 xaml,←⊂'        </sftools:SfCalculator>'
 xaml,←⊂'    </StackPanel>'
 xaml,←⊂'</Window>'


Code


∇  z←Calculator w;⎕IO;⎕ML;xaml;⎕USING;itemslist
⍝ Simple Calculator example
 ⎕IO ⎕ML←0 3
 xaml←CalculatorXAML
 window←#.UTIL.WPF.LoadXaml xaml(⊂'SyncTools')
 window_calc←window.FindName⊂'calc'
 {}window.ShowDialog
 z←window_calc.Value


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

'Syncfusion.SfInput.WPF,Syncfusion/4.5/Syncfusion.SfInput.WPF.dll'

 to the ⎕USING list of LoadXAML.

Operation


      #.Calculator.Calculator ⍬   
40           

Unresolved Issues