<Window x:Class="EarTrumpet.ColorTool.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:Event="clr-namespace:EarTrumpet.Extensions.EventBinding;assembly=EarTrumpet"
        xmlns:local="clr-namespace:EarTrumpet.ColorTool"
        Title="Color Viewer"
        Width="800"
        Height="450"
        WindowStartupLocation="CenterScreen">
    <Window.DataContext>
        <local:ColorViewModel />
    </Window.DataContext>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <TextBox TextChanged="{Event:Binding OnTextChanged}" />
        <ListView Grid.Row="1" ItemsSource="{Binding Colors}">
            <ListView.ItemTemplate>
                <DataTemplate DataType="local:ColorItemViewModel">
                    <StackPanel Height="14" Orientation="Horizontal">
                        <TextBlock Width="30"
                                   VerticalAlignment="Center"
                                   Text="{Binding Opacity}" />
                        <Border Width="40"
                                Height="14"
                                Background="{Binding Color}" />
                        <TextBlock VerticalAlignment="Center" Text="{Binding Name}" />
                    </StackPanel>
                </DataTemplate>
            </ListView.ItemTemplate>
        </ListView>
    </Grid>
</Window>
