TileViewControl


Display a window containing a TileViewControl taking its data from an XML file...


XAML


    ∇ xaml←TileViewControlXAML(title file);⎕IO;⎕ML;itemname
⍝ XAML for the TileViewControl example
 ⎕IO ⎕ML←0 3
 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.Shared;assembly=SyncFusion.Shared.WPF"'
 xaml,←⊂'    SizeToContent="WidthandHeight" Title="',title,'">'
 xaml,←⊂'    <StackPanel>'
 xaml,←⊂'       <StackPanel.Resources>'
 xaml,←⊂'           <XmlDataProvider Source="',file,'" x:Key="xmlSource" XPath="Books"/>'
 xaml,←⊂'       </StackPanel.Resources>'
 xaml,←⊂'       <sftools:TileViewControl ItemsSource="{Binding Source={StaticResource xmlSource}, XPath=Book}" Height="400" Width="400" >'
 xaml,←⊂'           <sftools:TileViewControl.ItemContainerStyle>'
 xaml,←⊂'              <Style TargetType="{x:Type sftools:TileViewItem}">'
 xaml,←⊂'                 <Setter Property="Header" Value="{Binding XPath=@Name}" />'
 xaml,←⊂'                 <Setter Property="ContentTemplate">'
 xaml,←⊂'                    <Setter.Value>'
 xaml,←⊂'                       <DataTemplate>'
 xaml,←⊂'                          <TextBlock Text="{Binding XPath=@Description}" TextWrapping="Wrap"/>'
 xaml,←⊂'                       </DataTemplate>'
 xaml,←⊂'                    </Setter.Value>'
 xaml,←⊂'                 </Setter>                    '
 xaml,←⊂'             </Style>'
 xaml,←⊂'           </sftools:TileViewControl.ItemContainerStyle>'
 xaml,←⊂'       </sftools:TileViewControl>'
 xaml,←⊂'    </StackPanel>'
 xaml,←⊂'</Window>'
    ∇

Code

    ∇  TileViewControl(title file);⎕IO;⎕ML;xaml
⍝ Simple TileViewControl example
 ⎕IO ⎕ML←0 3
 xaml←TileViewControlXAML title file
 #.window←#.UTIL.WPF.LoadXaml xaml(⊂'SyncTools')
 {}#.window.ShowDialog
    ∇

XML File


<?xml version="1.0" ?>
<Books>
  <Book Name="Programming C# 4.0" Description="Learn C# fundamentals, such as variables, flow control, loops, and methods"/>
  <Book Name="Programming WPF" Description="A tutorial on XAML, the new HTML-like markup language for declaring Windows UI"/>
  <Book Name="Essential WPF" Description="Visuals and media, including 2D, 3D, video, and animation"/>
  <Book Name="WPF Unleashed" Description="Examines the WPF feature areas in incredible depth: controls, layout, resources, data binding, styling, graphics, animation, and more"/>  
</Books>

Operation

      #.TileViewControl.TileViewControl 'Nerdy Books' 'd:\dick\temp\syncbooks.xml'

Unresolved Issues