<Window x:Class="dealer.OwnersWindow"
    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:dealer"
    mc:Ignorable="d"
    Title="Sprava vlastniku" Height="500" Width="700"
    WindowStartupLocation="CenterOwner">
    <Grid Margin="10">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <TextBlock Grid.Row="0"
            Text="Evidence vlastniku"
            FontSize="24"
            FontWeight="Bold"
            Margin="0,0,0,10"
            HorizontalAlignment="Center" />

        <Grid Grid.Row="1" Margin="0,0,0,10">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <TextBlock Text="Hledat:" VerticalAlignment="Center" Margin="0,0,10,0" />
            <TextBox Name="SearchTextBox" 
                Grid.Column="1" 
                Padding="5"
                TextChanged="SearchTextBox_TextChanged" />
        </Grid>

        <ListView Grid.Row="2"
            Name="OwnersListView"
            Margin="0,0,0,10"
            MouseDoubleClick="OwnersListView_MouseDoubleClick">
            <ListView.View>
                <GridView>
                    <GridViewColumn Header="Jmeno" Width="120" DisplayMemberBinding="{Binding Jmeno}" />
                    <GridViewColumn Header="Prijmeni" Width="120" DisplayMemberBinding="{Binding Prijmeni}" />
                    <GridViewColumn Header="Telefon" Width="120" DisplayMemberBinding="{Binding Telefon}" />
                    <GridViewColumn Header="Email" Width="180" DisplayMemberBinding="{Binding Email}" />
                    <GridViewColumn Header="Adresa" Width="150" DisplayMemberBinding="{Binding Adresa}" />
                </GridView>
            </ListView.View>
        </ListView>

        <StackPanel Grid.Row="3"
            Orientation="Horizontal"
            HorizontalAlignment="Center">
            <Button Name="AddButton"
                Content="Pridat vlastnika"
                Width="130"
                Height="35"
                Margin="5"
                FontSize="14"
                Click="AddButton_Click" />
            <Button Name="EditButton"
                Content="Upravit"
                Width="100"
                Height="35"
                Margin="5"
                FontSize="14"
                Click="EditButton_Click" />
            <Button Name="DeleteButton"
                Content="Smazat"
                Width="100"
                Height="35"
                Margin="5"
                FontSize="14"
                Click="DeleteButton_Click" />
            <Button Name="CloseButton"
                Content="Zavrit"
                Width="100"
                Height="35"
                Margin="5"
                FontSize="14"
                Click="CloseButton_Click" />
        </StackPanel>
    </Grid>
</Window>
