<Window x:Class="R6_ListView.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"
        xmlns:local="clr-namespace:R6_ListView"
        mc:Ignorable="d"
        Title="Lista produktów" Height="350" Width="525">
    <Window.Resources>
        <Style TargetType="ListViewItem">
            <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        </Style>
    </Window.Resources>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Label Content="Filtruj wg nazwy produktu:" Grid.Row="0" Grid.Column="0" Margin="5"/>
        <TextBox Name="txtFilter" Grid.Row="0" Grid.Column="1" Margin="5" TextChanged="txtFilter_TextChanged"/>
        <ListView x:Name="lstProdukty" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Margin="5" MouseDoubleClick="lstProdukty_MouseDoubleClick">
            <ListView.View>
                <GridView>
                    <GridView.Columns>
                        <GridViewColumn Header="Symbol" Width="Auto"
                            DisplayMemberBinding="{Binding Symbol}" />
                        <GridViewColumn Header="Nazwa"
                            DisplayMemberBinding="{Binding Nazwa}" />
                        <!--GridViewColumn Header="Liczba sztuk"
                            DisplayMemberBinding="{Binding LiczbaSztuk}"/-->
                        <GridViewColumn Header="Liczba sztuk">
                            <GridViewColumn.CellTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding LiczbaSztuk}"  
                                         FontSize="12" Foreground="Green" FontWeight="Bold" Background ="LightGray" TextAlignment="Right"/>
                                </DataTemplate>
                            </GridViewColumn.CellTemplate>
                        </GridViewColumn>

                        <GridViewColumn Header="Magazyn"
                            DisplayMemberBinding="{Binding Magazyn}" />
                    </GridView.Columns>
                </GridView>
            </ListView.View>
        </ListView>
    </Grid>

</Window>
