Skip to content

Instantly share code, notes, and snippets.

@JohanLarsson
Created December 28, 2013 21:09
Show Gist options
  • Save JohanLarsson/8164234 to your computer and use it in GitHub Desktop.
Save JohanLarsson/8164234 to your computer and use it in GitHub Desktop.
<Window x:Class="ListViewBox.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib"
Title="MainWindow" Height="350" Width="525">
<Window.Resources>
<DataTemplate x:Key="Boxes" DataType="{x:Type system:DateTime}">
<Border Background="Beige" Height="200" Width="299">
<TextBlock Text="{Binding DayOfWeek}"></TextBlock>
</Border>
</DataTemplate>
<DataTemplate x:Key="Circles" DataType="{x:Type system:DateTime}">
<Grid>
<Ellipse Fill="LightBlue" Height="200" Width="299"/>
<TextBlock Text="{Binding Year}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Grid>
</DataTemplate>
<ItemsPanelTemplate x:Key="Wrap">
<WrapPanel/>
</ItemsPanelTemplate>
<ItemsPanelTemplate x:Key="Stack">
<StackPanel/>
</ItemsPanelTemplate>
</Window.Resources>
<Grid>
<ListView ItemTemplate="{StaticResource Circles}" ItemsPanel="{StaticResource Wrap}">
<system:DateTime>2013-12-25</system:DateTime>
<system:DateTime>2013-12-26</system:DateTime>
<system:DateTime>2013-12-27</system:DateTime>
<system:DateTime>2013-12-28</system:DateTime>
</ListView>
</Grid>
</Window>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment