<UserControl xmlns="https://github.com/avaloniaui"
             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:vm="clr-namespace:FastBill.ViewModels"
             mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
             x:DataType="vm:CustomerViewModel"
             x:Class="FastBill.Views.CustomerView">
    <Design.DataContext>
        <vm:CustomerViewModel></vm:CustomerViewModel>
    </Design.DataContext>
    <Grid ColumnDefinitions="*,4,*">
        <Grid Grid.Column="0" Margin="20" RowDefinitions="Auto,*">
            <StackPanel Grid.Row="0" Margin="0 0 0 5">
                <TextBox Text="{Binding Term}" Margin="0 5"></TextBox>
                <Button Content="Search" Command="{Binding SearchCustomer}"></Button>
            </StackPanel>
            <DataGrid Grid.Row="1" ItemsSource="{Binding Customers}"
                      AutoGenerateColumns="False" IsReadOnly="True" 
                      GridLinesVisibility="All"
                      BorderThickness="1" BorderBrush="Gray"
                      x:Name="CustomerTable">
                <DataGrid.Columns>
                    <DataGridTemplateColumn Width="*" Header="Id">
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <TextBox
                                    Text="{Binding Id}"
                                />
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>
                    <DataGridTemplateColumn Width="*" Header="Nr">
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <TextBox
                                    Text="{Binding Nr}"
                                     />
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>
                    <DataGridTextColumn Width="*" Header="Company" Binding="{Binding Company}" />
                    <DataGridTextColumn Width="*" Header="Firstname" Binding="{Binding Firstname}" />
                    <DataGridTextColumn Width="*" Header="Lastname" Binding="{Binding Lastname}" />
                </DataGrid.Columns>
            </DataGrid>
        </Grid>
        <GridSplitter Grid.Column="1" Background="Black" ResizeDirection="Columns"/>
        <StackPanel Grid.Column="2" Margin="5 0">
            
        </StackPanel>
    </Grid>
    
    
</UserControl>
