TileView is the second of four view components for Silverlight that are used in the Bing component.
The purpose of TileView is to provide a tiled list which displays any data items and with any particular internal item layout. Like StackView, TileView could be easily implemented with a stock ItemsControl and a WrapPanel from the Silverlight toolkit.
But TileView, like the other views in the Views toolkit, provides an additional function - the animation of items following a data bind. TileView provides a optional seek-from-origin style animation for each item, which fire in sequence as the items are added.

-
Declare the Control in Xaml
The following Xaml fragment is a complete declaration of a TileView. This fragment is actually taken from the Bing component supplied with this SDK.
Example
CopyC#
<views:TileView x:Name="TileView" Width="Auto" Height="Auto" TileWidth="200" TileHeight="200" TileSpacing="8"> </views:TileView>
-
Style the Item Template (optional)
You will need to supply an item template for your particular data binding scenario. To keep the discussion focused on Microsoft Bing, we'll show an ItemTemplate for a SearchResult object.
Example
CopyC#
<views:TileView x:Name="TileView" Width="Auto" Height="Auto"> <views:TileView.ItemTemplate> <DataTemplate> <Grid Margin="2"> <Grid.RowDefinitions> <RowDefinition Height="128"/> <RowDefinition Height="*"/> </Grid.RowDefinitions> <Image x:Name="Icon" Grid.Row="0" Width="Auto" Height="128" Source="{Binding LargeIconUrl}" Stretch="Uniform"/> <views:LinkLabel Text="{Binding Title}" NavigateUri="{Binding Url}" Grid.Row="1" FontWeight="Normal" FontSize="11" Margin="2" TextAlignment="Center" TextWrapping="Wrap" Width="Auto"/> </Grid> </DataTemplate> </views:TileView.ItemTemplate> </views:TileView>
-
Bind Data to the Control
Finally, we need to bind some actual data to the control. The TileView is derived from ItemsControl, and as such we can data bind any IEnumerable source to it. The best practice for Silverlight is to use an ObservableCollection<T> from the System.Collections.ObjectModel namespace. This generic collection is designed for use with ItemsControl instances and allows for the collection to be modified at runtime. An asychronous layout will be used to repopulate the bound control automatically.
In the Microsoft Bing runtime, the SearchEnvironment provides the SearchResults type, which is derived from ObservableCollection<T>.
Example
CopyC#
//We either pre-bind to an ObservableCollection instance, or we can bind on demand to other collection types, //such as System.Collections.Generic.List or directly to System.Array instances from service proxy results TileView.ItemsSource = SearchEnvironment.Default.SearchResults;