<ListBox Name="lvDataBinding" SelectionMode="Single" ItemsSource="{Binding AllTiles}" VirtualizingPanel.VirtualizationMode="Recycling"> <ListBox.ItemsPanel > <ItemsPanelTemplate> <WrapPanel Width="{Binding (FrameworkElement.ActualWidth), RelativeSource={RelativeSource AncestorType=ScrollContentPresenter}}"> </WrapPanel> </ItemsPanelTemplate> </ListBox.ItemsPanel> <ListBox.ItemTemplate> <DataTemplate> <custom:TileControl Margin="10" DataContext="{Binding}"/> </DataTemplate> </ListBox.ItemTemplate> <ListBox.ItemContainerStyle> <Style> <Style.Resources> <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Transparent"/> </Style.Resources> </Style> </ListBox.ItemContainerStyle> <ListBox.GroupStyle> <GroupStyle> <GroupStyle.ContainerStyle> <Style TargetType="{x:Type GroupItem}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate> <Expander Header="{Binding}" IsExpanded="True"> <Expander.HeaderTemplate> <DataTemplate> <StackPanel Orientation="Horizontal" Background="Transparent"> <TextBlock Text="{Binding Name}" TextBlock.FontSize="20" /> </StackPanel> </DataTemplate> </Expander.HeaderTemplate> <ItemsPresenter /> </Expander> </ControlTemplate> </Setter.Value> </Setter> </Style> </GroupStyle.ContainerStyle> </GroupStyle> </ListBox.GroupStyle> </ListBox>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)