<pre><Window x:Class="ColorListBox.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" Title="MainWindow" Height="450" Width="800"> <Window.Resources> </Window.Resources> <Grid> <StackPanel Orientation="Vertical"> <ListBox ItemsSource="{Colors}" Height="100"> <ListBox.ItemTemplate> <DataTemplate> <Rectangle Width="100" Height="50" Fill="{Binding}" /> </DataTemplate> </ListBox.ItemTemplate> </ListBox> </StackPanel> </Grid> </Window>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)