FontListBox


Display a list of available fonts, allowing the user to select one.



XAML


∇ xaml←FontListBoxXAML
⍝ XAML for the FontListBox 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:FontListBox Name="fontlist" Height="200">'
 xaml,←⊂'        </sftools:FontListBox>'
 xaml,←⊂'    </StackPanel>'
 xaml,←⊂'</Window>'


Code


∇  z←FontListBox;⎕IO;⎕ML;xaml;⎕USING;brush
⍝ Simple FontListBox example
 ⎕IO ⎕ML←0 3
 xaml←FontListBoxXAML
 #.window←#.UTIL.WPF.LoadXaml xaml(⊂'SyncTools')
 window_fontlist←#.window.FindName⊂'fontlist'
 {}#.window.ShowDialog
 z←window_fontlist.SelectedFontFamily


Having set the Height explicitly, the control really needs to be scrollable - haven't figured that out yet...

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 (note that the SyncFusion documentation is (to say the least) misleading for this control

Operation


       #.FontListBox.FontListBox      
Mangal 


(make sure you select something)

Unresolved Issues