How do I...Set a left arg to my Click event on a Button

Using Microsoft Windows Presentation Foundation and Syncfusion WPF Libraries
Post Reply
User avatar
Fiona|Dyalog
Posts: 77
Joined: Mon Apr 22, 2013 12:59 pm

How do I...Set a left arg to my Click event on a Button

Post by Fiona|Dyalog »

In APL:

      ⎕USING←'' 'System.Windows,WPF/PresentationFramework.DLL'
⎕USING,←⊂'System.Windows.Controls'
btn←⎕NEW Button
btn #.WPF.Event.Add 'Click' 'foo' (Other Data)
foo ⍝ Add lists all handlers as its result


In XAML:

Code: Select all

xmlns:apl="clr-namespace:MJHSoftware;assembly=MJHSoftware.APLExtension"
<Button Click="{apl:Event foo,Left=Other Data}" />


where function foo has the form:
      ∇ {la} foo(Sender e)
[1] e.Handled←1 ⍝ Marks the event as "handled"


In the XAML case, only the text 'Other Data' is passed as the left argument while in the APL version Other and Data are APL arrays.
Post Reply