<Page x:Class="JAMM.Kasse.Pages.Tables"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      xmlns:models="clr-namespace:JAMM.Kasse.Models"
      mc:Ignorable="d" 
      d:DesignHeight="300" d:DesignWidth="300"
	Title="Table">
    <ScrollViewer>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Border Grid.Row="0">
                <Border.Background>
                    <SolidColorBrush Color="White"></SolidColorBrush>
                </Border.Background>
            </Border>
            <Border BorderBrush="LightGray" BorderThickness="0, 0, 0, 1">
                <Grid>
                    <Button Grid.Row="0" x:Name="backButton" Content="Zurück" Height="30" Width="80" HorizontalAlignment="Left" Margin="10,6,0,6" VerticalAlignment="Center" Click="back"/>
                    <Label HorizontalAlignment="Center" FontSize="24">Tische</Label>
                    <Button Grid.Row="0" x:Name="logoutButton" Content="Logout" Height="30" Width="80" HorizontalAlignment="Right" Margin="0,5,10,5" VerticalAlignment="Center" Click="logout"/>
                </Grid>
            </Border>
            <Border BorderBrush="LightGray" BorderThickness="0, 0, 0, 1" Grid.Row="2">
                <Grid>
                    <TextBox Grid.Row="2" x:Name="searchBox" Height="30" Margin="10,10,95,10" VerticalContentAlignment="Center" />
                    <Button Grid.Row="2" x:Name="search" Content="Suche" Height="30" Width="80" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,10,0" Click="Search"></Button>
                </Grid>
            </Border>
            <ItemsControl Name="TableView" Grid.Row="1">
                <ItemsControl.ItemsPanel>
                    <ItemsPanelTemplate>
                        <WrapPanel ItemHeight="100" ItemWidth="150" />
                    </ItemsPanelTemplate>
                </ItemsControl.ItemsPanel>
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <Button Margin="10" Content="{Binding ButtonLabel}" Click="selectTable"/>
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>
        </Grid>
    </ScrollViewer>
</Page>
