<Window x:Class="Gremlin.GremlinUI.QuoteUI"
        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:viewmodels="clr-namespace:Gremlin.GremlinUI.ViewModels" d:DataContext="{d:DesignInstance Type=viewmodels:QuoteVM}"
        mc:Ignorable="d"
        ResizeMode="NoResize"
        WindowStartupLocation="CenterScreen"
        Title="Gremlin QuoteUI" Height="1024" Width="1280">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <Grid Grid.Row="0" Height="Auto" x:Name="gridOben" Margin="10,5,10,5" >
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>

            <StackPanel x:Name="Contact" Grid.Row="0" Grid.Column="0" Orientation="Vertical">

                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="2*" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <StackPanel Grid.Column="0">
                        <TextBox x:Name="tbContactSearch" TextWrapping="NoWrap" Margin="10,5,10,5" TextAlignment="Center" TextChanged="TbContactSearch_TextChanged"/>
                    </StackPanel>
                    <StackPanel Grid.Column="1">
                        <Button x:Name="butReloadContacts" Content="Kontakte laden" Margin="10,5,10,5" Click="ButReloadContacts_Click" />
                    </StackPanel>
                </Grid>

                <DataGrid x:Name="dgFoundContacts"
                          ItemsSource="{Binding Source=foundContacts}"
                          AutoGenerateColumns="True"
                          Height="250"
                          Margin="10,5,10,5"
                          AlternatingRowBackground="LightGray" SelectionChanged="DgFoundContacts_SelectionChanged">
                </DataGrid>
            </StackPanel>

            <StackPanel x:Name="Angebotskonfig" Grid.Row="0" Grid.Column="1" Orientation="Vertical">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>

                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>

                    <Grid Grid.Column="0" Height="Auto">
                        <StackPanel>
                            <TextBlock x:Name="lblAngebotsname" Text="Angebotsname" TextAlignment="Right" Margin="10,5,10,5"/>
                            <TextBlock x:Name="lblAngebotsnummer" Text="Angebotsnummer" TextAlignment="Right" Margin="10,5,10,5"/>
                            <TextBlock x:Name="lblQuotingPath" Text="Angebotspfad" TextAlignment="Right" Margin="10,5,10,5"/>
                            <TextBlock x:Name="lblGewaehrleistung" Text="Gewährleistung (Monate)" TextAlignment="Right" Margin="10,5,10,5"/>
                            <TextBlock x:Name="lblAngebotsgueltigkeit" Text="Angebotsgültigkeit (Tage)" TextAlignment="Right" Margin="10,5,10,5"/>
                            <TextBlock x:Name="lblOppID" Text="SAP Opp ID" TextAlignment="Right" Margin="10,5,10,5"/>
                        </StackPanel>
                    </Grid>

                    <Grid Grid.Column="1" Height="Auto">
                        <StackPanel>
                            <TextBox x:Name="tbQuoteType" Text="ein Analysegerät" Margin="10,4,10,4" TextChanged="TbQuoteType_TextChanged" />
                            <TextBox x:Name="tbQuoteNumber" Text="DE-83PE89-421-6000" Margin="10,4,10,4" TextChanged="TbQuoteNumber_TextChanged" />
                            <TextBox x:Name="tbQuotePath" Text="D:\Coding\Gremlin\Gremlin\bin\Debug\net5.0-windows" Margin="10,4,10,4" TextChanged="TbQuotePath" />
                            <TextBox x:Name="tbWarranty" Text="12" Margin="10,4,10,4" TextChanged="TbWarranty_TextChanged" />
                            <TextBox x:Name="tbValidity" Text="60" Margin="10,5,10,5" TextChanged="TbValidity_TextChanged" />
                            <TextBox x:Name="tbOppID" Text="3003541659" Margin="10,4,10,4" />
                        </StackPanel>
                    </Grid>
                </Grid>
            </StackPanel>

            <StackPanel x:Name="Opp" Grid.Row="0" Grid.Column="2" Orientation="Vertical">
                <CheckBox d:DataContext="{d:DesignInstance Type=viewmodels:QuoteVM}" x:Name="cbBrutto" Content="Brutto anzeigen" Margin="10,5,10,5" IsChecked="{Binding Path=Brutto, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Click="CbBrutto_Click"/>
                <CheckBox x:Name="cbSinglePrices" Content="Einzelpreise ausweisen" Margin="10,5,10,5" IsChecked="True" Click="CbSinglePrices_Click" />
                <CheckBox x:Name="cbBrochure" Content="Broschüren anhängen" Margin="10,5,10,5" Click="CbBrochure_Click" />
                <CheckBox x:Name="cbDataSheets" Content="Datenblätter anhängen" Margin="10,5,10,5" Click="CbDataSheets_Click" />
                <CheckBox x:Name="cbMailTemplate" Content="Mail aus Template erstellen" Margin="10,5,10,5" Click="CbMailTemplate_Click" />
            </StackPanel>
        </Grid>

        <Grid Grid.Row="1" Height="Auto" x:Name="gridMitte" Margin="10,5,10,5">
            <StackPanel>
                <DataGrid x:Name="dgLineItems" AutoGenerateColumns="True" Height="600" Margin="10,5,10,5" />
            </StackPanel>
        </Grid>

        <Grid Grid.Row="3" Height="Auto" x:Name="gridUnten" Margin="10,5,10,5">
            <StackPanel Orientation="Horizontal" Margin="10,5,10,5" HorizontalAlignment="Center">
                <Button x:Name="butPasteQuote" Content="Angebot aus PriceSurfer erstellen" Margin="10,5,10,5" Click="ButPasteQuote_Click" MinWidth="280" />
                <Button x:Name="butCreateTex" Content="Tex erstellen" Margin="10,5,10,5" Click="ButCreateTex_Click" MinWidth="280" />
                <Button x:Name="butCreateQuote" Content="Angebot als PDF erstellen" Margin="10,5,10,5" Click="ButCreateQuote_Click" MinWidth="280" />
                <Button x:Name="butSendQuote" Content="Angebot als Anhang in Mail-Entwurf erstellen" Margin="10,5,10,5" Click="ButSendQuote_Click" MinWidth="280" />
            </StackPanel>
        </Grid>
    </Grid>
</Window>
