AutoComplete


Display a Window containing an AutoComplete control populated from a list of values,  returning the text when the Window is closed.



XAML


∇  xaml←AutoCompleteXAML
⍝ XAML for the AutoComplete 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.Tools.WPF"'
 xaml,←⊂'    SizeToContent="WidthandHeight" >'
 xaml,←⊂'    <StackPanel>'
 xaml,←⊂'         <sftools:AutoComplete Name="acExample">'
 xaml,←⊂'        </sftools:AutoComplete>'
 xaml,←⊂'    </StackPanel>'
 xaml,←⊂'</Window>'


Code


z←AutoComplete items;⎕IO;⎕ML;xaml
⍝ Simple AutoComplete example
 ⎕IO ⎕ML←0 3
 xaml←AutoCompleteXAML
 window←#.UTIL.WPF.LoadXaml xaml(⊂'SyncTools')
 window_acExample←window.FindName⊂'acExample'
 {{}window_acExample.Items.Add⊂⍵}¨items
 {}window.ShowDialog
 z←window_acExample.Text


Note - although the optimistic might have hoped that this control could serve the purpose of type-ahead in a text window it seems to be limited to this variant of a ComboBox.

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

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

 to the ⎕USING list of LoadXAML

Operation


       #.AutoComplete.AutoComplete 'this' 'that' 'the other'
the other

Unresolved Issues