<Window x:Class="Pos.SalesWindow"
        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:Pos"
        mc:Ignorable="d"
        WindowState="Maximized"
        SizeToContent="Manual"
        Title="Salg" Height="450" Width="800" Icon="Icons/cashier.png">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1.5*"/>
            <ColumnDefinition Width="3*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="1.5*"/>
            <RowDefinition Height="2.5*"/>
            <RowDefinition Height="1.4*"/>
            <RowDefinition Height="1.2*"/>
            <RowDefinition Height="1.5*"/>
            <RowDefinition Height="5*"/>
        </Grid.RowDefinitions>
        <GroupBox Name="GrpEmployee" Grid.Row="0" Grid.Column="1" Style="{StaticResource GroupBox}">
            <GroupBox.Header>
                <Label>Medarbejder</Label>
            </GroupBox.Header>
            <StackPanel VerticalAlignment="Top">
                <DockPanel Name="DockEmployee" Dock="Top" LastChildFill="False"/>
            </StackPanel>
        </GroupBox>
        <GroupBox Grid.Row="1" Grid.Column="1" Style="{StaticResource GroupBox}">
            <GroupBox.Header>
                <Label>Varer</Label>
            </GroupBox.Header>
            <WrapPanel VerticalAlignment="Top" Name="DockProductGroup">
            </WrapPanel>
        </GroupBox>
        <!--<GroupBox Grid.Row="2" Grid.Column="1" Style="{StaticResource GroupBox}">
            <GroupBox.Header>
                <Label>Vare</Label>
            </GroupBox.Header>
            <StackPanel VerticalAlignment="Top">
                <WrapPanel Name="DockProduct" HorizontalAlignment="Left" VerticalAlignment="Top" Orientation="Horizontal"/>
            </StackPanel>
        </GroupBox>-->
        <GroupBox Grid.Row="2" Grid.Column="1" Name="PriceSection" Style="{StaticResource GroupBox}">
            <GroupBox.Header>
                <Label>Pris</Label>
            </GroupBox.Header>
            <WrapPanel Name="PricePanel" HorizontalAlignment="Left" VerticalAlignment="Center" Orientation="Horizontal">
                <Label Name="LblStk" Content="Stk:" Style="{StaticResource StandardLabel}"/>
                <TextBox Name="NumberOfProducts" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Width="50" Text="1" Margin="10,0,0,0" FontSize="20" GotFocus="NumberOfProducts_GotFocus" LostFocus="NumberOfProducts_LostFocus"/>
                <Label Name="LblPrice" Content="Pris:"  Style="{StaticResource StandardLabel}"/>
                <TextBox Name="Price" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Width="130" Margin="10,0,0,0" FontSize="20" KeyUp="Price_KeyUp"/>
                <Button Name="BtnBuy" Content="Køb" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Padding="10,0,10,0" Margin="10,0,0,0" Click="Buy_Click"/>
                <Label Name="LblTotal" Content="Total pris:  Kr." VerticalContentAlignment="Center" HorizontalContentAlignment="Center"  Style="{StaticResource StandardLabel}" Padding="30,0,0,0"/>
                <Label Name="TotalPrice" VerticalContentAlignment="Center" HorizontalContentAlignment="Center"  Style="{StaticResource StandardLabel}" Content="0,-" />
            </WrapPanel>
        </GroupBox>
        <GroupBox Grid.Row="3" Grid.Column="1" Name="PaymentSection" Style="{StaticResource GroupBox}" Header="Betaling">
                <WrapPanel Name="PaymentPanel" HorizontalAlignment="Left" VerticalAlignment="Center" Orientation="Horizontal">
                    <Label Name="LblAmount"  Style="{StaticResource StandardLabel}">Beløb:</Label>
                    <TextBox Name="Amount" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Width="130" Margin="10,0,0,0" FontSize="20"/>
                    <Button Name="BtnCash" Content="Kontant" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Padding="10,0,10,0" Margin="10,0,0,0" Click="Payment_Click" Tag="PaymentMethod.Cash"/>
                    <Button Name="BtnCard" Content="Kort" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Padding="10,0,10,0" Margin="10,0,0,0" Click="Payment_Click" Tag="PaymentMethod.Card"/>
                    <Button Name="BtnMb" Content="MobilePay" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Padding="10,0,10,0" Margin="10,0,0,0" Click="Payment_Click" Tag="PaymentMethod.MobilePay"/>
                    <Button Name="BtnBuyGiftCard" Content="Gavekort" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Padding="10,0,10,0" Margin="10,0,0,0" Click="Payment_Click"  Tag="PaymentMethod.GiftCard"/>
                </WrapPanel>        
        </GroupBox>

        <StackPanel Width="Auto" Height="Auto" Grid.Row="0" Grid.RowSpan="6" Grid.Column="0" VerticalAlignment="Top" CanVerticallyScroll="True" >
            <Label Content="Salg:" Style="{StaticResource StandardBoldBigText}"/>
            <Grid>
                <DataGrid VerticalScrollBarVisibility="Auto" x:Name="SaleGrid" SelectionChanged="SaleGrid_OnSelectionChanged" AutoGenerateColumns="False" Style="{StaticResource StandardBigText}" GridLinesVisibility="None" BorderThickness="0" HeadersVisibility="None" KeyUp="SaleGrid_KeyUp">
                    <DataGrid.CellStyle>
                        <Style TargetType="DataGridCell" >
                            <Setter Property="Margin" Value="0,5,4,0"></Setter>
                        </Style>
                    </DataGrid.CellStyle>
                    <DataGrid.Columns>
                        <DataGridTextColumn Binding="{Binding Path=Navn }"></DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding Path=Stk }"></DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding Path=Pris }"></DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding Path=Total }"></DataGridTextColumn>
                    </DataGrid.Columns>
                </DataGrid>
            </Grid>
            <Label Name="Total" Style="{StaticResource StandardBoldBigText}"/>
            <Separator/>
            <Label Content="Betalt:"  Style="{StaticResource StandardBoldBigText}"/>
            <Grid>
                <DataGrid Name="PaymentGrid" Style="{StaticResource StandardBigText}" AutoGenerateColumns="False" GridLinesVisibility="None" BorderThickness="0" HeadersVisibility="None">
                    <DataGrid.CellStyle>
                        <Style TargetType="DataGridCell" >
                            <Setter Property="Margin" Value="0,5,4,0"></Setter>
                        </Style>
                    </DataGrid.CellStyle>
                    <DataGrid.Columns>
                        <DataGridTextColumn Width="120" Binding="{Binding Path=PaymentMethodText}" />
                        <DataGridTextColumn Width="100" Binding="{Binding Path=AmountText}"/>
                    </DataGrid.Columns>
                </DataGrid>
            </Grid>
            <Label Name="lblRecived" Style="{StaticResource StandardBoldBigText}"/>
            <Button Name="btnFinish" Content="Afslut" IsEnabled="False" Click="btnFinish_Click"/>
        </StackPanel>
        <GroupBox Grid.Column="1" Grid.Row="4" Name="Misc" Style="{StaticResource GroupBox}" HorizontalAlignment="Stretch" VerticalAlignment="Top" Header="Diverse">
            <WrapPanel HorizontalAlignment="Left" VerticalAlignment="Top">
                <Button Name="BtnPrint" Content="Print bon" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Padding="10,0,10,0" Margin="10,10,10,10" Click="BtnPrint_Click" />
            </WrapPanel>
        </GroupBox>
    </Grid>
</Window>
    