<Window x:Class="DatabaseEditor.Views.BookSelectWindow"
        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:views="clr-namespace:DatabaseEditor.Views"
        xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
        DataContext="{Binding Source={StaticResource ViewModelLocator}, Path=SelectBookViewModel}"
        mc:Ignorable="d"
        Title="Add book ..." Height="300" Width="300">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>

            <TextBox Name="SearchBox" Text="{Binding SearchBoxText, Mode=OneWayToSource, UpdateSourceTrigger=PropertyChanged}"/>
            <ComboBox Grid.Column="1"
                      SelectedIndex="0" ItemsSource="{Binding SearchableProperties}"
                      DisplayMemberPath="Key"
                      SelectedItem="{Binding SelectedProperty, Mode=OneWayToSource}" />
            <Button Grid.Column="2" Content="Search" Command="{Binding SearchCommand}"/>
        </Grid>
        <Grid Grid.Row="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <ListView Name="ListView" ItemsSource="{Binding ItemsCollection}">
                <ListView.View>
                    <GridView x:Name="GridView">
                        <GridViewColumn DisplayMemberBinding="{Binding Name}" Header="Name" />
                        <GridViewColumn DisplayMemberBinding="{Binding Pages}" Header="Pages" />
                        <GridViewColumn DisplayMemberBinding="{Binding Year}" Header="Year" />
                    </GridView>
                </ListView.View>
            </ListView>
            <DockPanel Grid.Row="1">
                <Button Content="Cancel" IsCancel="True" />
                <Button Content="Confirm" IsDefault="True" Click="ButtonBase_OnClick"/>
            </DockPanel>
        </Grid>
    </Grid>
</Window>