Page 1 of 1

How to Inspect a Binding made with 2015⌶ ?

Posted: Sun Aug 31, 2014 1:54 pm
by PGilbert
If I do the following:

Code: Select all

 names←'Paul' 'Pierre' 'John' 'Alain' 'Michel'
 ⎕EX'ns'
 ns←⎕NS¨(⍴names)⍴⊂''
 ns.Names←names

 ⎕USING←'System.Windows,WPF/PresentationFramework.dll'
 win←⎕NEW Window

 win.DataContext←2015⌶'ns'

 dc←win.DataContext


I have now a collection with the property 'Names' bound to the DataContext of a Window. The question is: How to inspect that collection in APL and particularly how to read back the 'Names' from that collection using the variable 'dc' that is a Dyalog.Data.DataBoundCollectionHandler ?

Thanks in advance,

Re: How to Inspect a Binding made with 2015⌶ ?

Posted: Sun Aug 31, 2014 7:57 pm
by DanB|Dyalog
Is this what you mean?

Code: Select all

      ⌷dc
 Dyalog.Data.DataBoundNamespace  Dyalog.Data.DataBoundNamespace  ...
      1⌷⌷dc
Dyalog.Data.DataBoundNamespace
      (1⌷⌷dc).⎕nl-2
 ref
      (1⌷⌷dc).ref
#.[Namespace]
      (1⌷⌷dc).ref.⎕nl-2
 Names

Re: How to Inspect a Binding made with 2015⌶ ?

Posted: Sun Aug 31, 2014 11:37 pm
by PGilbert
Thanks Daniel you have answered my question. The code I was looking for was:

Code: Select all

     (⌷dc).ref.Names
 Paul  Pierre  John  Alain  Michel


Thanks again.