<Window x:Class="Superbuchhaltungv3.MainWindow"
        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:Superbuchhaltungv3"
        mc:Ignorable="d"
        Title="MainWindow" Height="450" Width="800"
        xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
        TextElement.Foreground="{DynamicResource MaterialDesignBody}"
        TextElement.FontWeight="Regular"
        TextElement.FontSize="13"
        TextOptions.TextFormattingMode="Ideal"
        TextOptions.TextRenderingMode="Auto"
        Background="{DynamicResource MaterialDesignPaper}"
        FontFamily="{DynamicResource MaterialDesignFont}"
        Closing="MainWindow_OnClosing">
    <TabControl>
        <TabItem>
            <TabItem.Header>
                <TextBlock Style="{DynamicResource MaterialDesignTextBlock}" Text="Konten" />
            </TabItem.Header>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="1*" />
                    <ColumnDefinition Width="2*" />
                </Grid.ColumnDefinitions>
                <DataGrid Style="{DynamicResource MaterialDesignDataGrid}" Name="FKontenListe" IsReadOnly="True"  Grid.Column="0" SelectedCellsChanged="FKontenListe_OnSelectedCellsChanged" >
                    <DataGrid.Columns>
                        <DataGridTextColumn Header="Kontonummer" Binding="{Binding KontenNummer}" Width="*"></DataGridTextColumn>
                        <DataGridTextColumn Header="Kontenname" Binding="{Binding KontenName}" Width="*"></DataGridTextColumn>
                    </DataGrid.Columns>
                </DataGrid>
                <GridSplitter Grid.Column="0" Style="{DynamicResource MaterialDesignGridSplitter}" Width="3"></GridSplitter>
                <DataGrid Style="{DynamicResource MaterialDesignDataGrid}" Name="FKontenBuchungListe" Grid.Column="1" SelectionChanged="DataGrid_SelectionChanged" AutoGenerateColumns="False">
                    <DataGrid.Columns>
                        <DataGridTextColumn Header="Datum" Binding="{Binding Datum}" Width="1.5*"></DataGridTextColumn>
                        <DataGridTextColumn Header="Gegenkonto" Binding="{Binding GegenKonto}" Width="3*"></DataGridTextColumn>
                        <DataGridTextColumn Header="Soll" Binding="{Binding Soll}" Width="2*"></DataGridTextColumn>
                        <DataGridTextColumn Header="Haben" Binding="{Binding Haben}" Width="2*"></DataGridTextColumn>
                    </DataGrid.Columns>
                </DataGrid>
            </Grid>
        </TabItem>
        <TabItem>
            <TabItem.Header>
                <TextBlock Style="{DynamicResource MaterialDesignTextBlock}" Text="Bearbeiten" />
            </TabItem.Header>
            <Viewbox>
            <Grid Width="437">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <ItemsControl Grid.Column="0" HorizontalAlignment="Center">
                        <TextBox Style="{DynamicResource MaterialDesignFilledTextBox}" Name="addkontokonteNummer" FontSize="10" materialDesign:HintAssist.Hint="Konten Nummer" materialDesign:HintAssist.FloatingOffset="10,-42" materialDesign:HintAssist.IsFloating="True"  Height="40" Width="100"  Margin="5"/>
                        <TextBox Style="{DynamicResource MaterialDesignFilledTextBox}" Name="addkontokontenName" FontSize="10" materialDesign:HintAssist.Hint="Konten Name" materialDesign:HintAssist.FloatingOffset="10,-42" materialDesign:HintAssist.IsFloating="True"  Height="40" Width="100"   Margin="5"/>
                        <Label  Style="{DynamicResource MaterialDesignLabel}" Content="Aktiv" FontSize="10" Height="20" Width="100" Margin="0,0,10,-15" />
                        <CheckBox Style="{DynamicResource MaterialDesignCheckBox}" Name="addkontoaktiv" FontSize="10" Height="40" Width="100"/>
                        <Button Style="{DynamicResource MaterialDesignRaisedButton}" Name="addkontoSubmitButton" Content="Hinzufügen" Width="110" Height="30" Margin="5" Click="AddkontoSubmitButton_Click"/>
                </ItemsControl>
                <GridSplitter Grid.Column="0" Width="1" IsManipulationEnabled="False" Style="{DynamicResource MaterialDesignGridSplitter}"></GridSplitter>
                <ItemsControl Grid.Column="1">
                        <ItemsControl>
                            <ItemsControl.ItemsPanel>
                                <ItemsPanelTemplate>
                                    <StackPanel Orientation="Horizontal"/>
                                </ItemsPanelTemplate>
                            </ItemsControl.ItemsPanel>
                            <TextBox Style="{DynamicResource MaterialDesignFilledTextBox}" Name="modifykontoLoad" FontSize="10" materialDesign:HintAssist.Hint="Edit Konto" materialDesign:HintAssist.FloatingOffset="10,-42" materialDesign:HintAssist.IsFloating="True"  Height="40" Width="110"  Margin="5" />
                            <Button Style="{DynamicResource MaterialDesignRaisedButton}" Name="modifykontoLoadButton" Content="Laden" Height="40" Width="85" Click="ModifykontoLoad_Click" ></Button>
                        </ItemsControl>
                        <ItemsControl>
                            <ItemsControl.ItemsPanel>
                                <ItemsPanelTemplate>
                                    <StackPanel Orientation="Horizontal"/>
                                </ItemsPanelTemplate>
                            </ItemsControl.ItemsPanel>
                            <TextBox Style="{DynamicResource MaterialDesignFilledTextBox}" Name="modifykontoNummer" FontSize="10" materialDesign:HintAssist.Hint="Konten Nummer" materialDesign:HintAssist.FloatingOffset="10,-42" materialDesign:HintAssist.IsFloating="True"  Height="40" Width="100"  Margin="5" />
                            <TextBox Style="{DynamicResource MaterialDesignFilledTextBox}" Name="modifykontoName" FontSize="10" materialDesign:HintAssist.Hint="Konten Name" materialDesign:HintAssist.FloatingOffset="10,-42" materialDesign:HintAssist.IsFloating="True"  Height="40" Width="100"  Margin="5" />
                        </ItemsControl>
                    <Label  Style="{DynamicResource MaterialDesignLabel}" Content="Aktiv" FontSize="10" Height="20" Width="210" Margin="0,0,10,-15" />
                        <CheckBox Style="{DynamicResource MaterialDesignCheckBox}" Name="modifykontoAktiv" FontSize="10" Height="40" Width="210"/>
                        <Button Style="{DynamicResource MaterialDesignRaisedButton}" Name="modifykontoSaveButton" Content="Speichern" Width="100" Height="30" Margin="5" Click="ModifykontoSaveButton_Click" />
                    </ItemsControl>
            </Grid>
            </Viewbox>
        </TabItem>
        <TabItem>
            <TabItem.Header>
                Buchungen
            </TabItem.Header>
          <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="*" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <Grid Grid.Row="0">
                    <TextBlock Style="{DynamicResource MaterialDesignHeadline5TextBlock}" Text="Soll" Height="30" VerticalAlignment="Top" />
                    <DataGrid Style="{DynamicResource MaterialDesignDataGrid}" Name="buchungensoll" VerticalAlignment="Stretch" Margin="0,30,0,0" Height="Auto" Width="Auto" IsReadOnly="False" CanUserAddRows="False" CanUserSortColumns="False" AutoGenerateColumns="False">
                        <DataGrid.Columns>
                            <DataGridTextColumn Header="Kontonummer" Binding="{Binding KontoNummer}" Width="*"/>
                            <DataGridTextColumn Header="Wert" Binding="{Binding Wert}" Width="*"/>
                        </DataGrid.Columns>
                    </DataGrid>
                    <Button Style="{DynamicResource MaterialDesignFloatingActionButton}" Name="buchungensollplus"  Content="{materialDesign:PackIcon Add}" Height="40" Width="40" VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="0,0,5,5" Click="Buchungensollplus_Click"/>
                    <Button Style="{DynamicResource MaterialDesignFloatingActionLightButton}" Name="buchungensollminus" Content="{materialDesign:PackIcon Minus}" Height="40" Width="40" VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="0,0,50,5" Click="Buchungensollminus_Click"/>
                </Grid>


                <GridSplitter Grid.Row="0"  Style="{DynamicResource MaterialDesignGridSplitter}" Height="3"></GridSplitter>

              <Grid Grid.Row="1">
                  <TextBlock Style="{DynamicResource MaterialDesignHeadline5TextBlock}" Text="Haben" Height="30" VerticalAlignment="Top"/>
                    <DataGrid Style="{DynamicResource MaterialDesignDataGrid}" Name="buchungenhaben"  VerticalAlignment="Stretch" Margin="0,30,0,0" Height="Auto" Width="Auto" IsReadOnly="False" CanUserAddRows="False" CanUserSortColumns="False" AutoGenerateColumns="False">
                      <DataGrid.Columns>
                          <DataGridTextColumn Header="Kontonummer" Width="*" Binding="{Binding KontoNummer}"/>
                          <DataGridTextColumn Header="Wert" Width="*" Binding="{Binding Wert}"/>
                      </DataGrid.Columns>
                  </DataGrid>
                  <Button Style="{DynamicResource MaterialDesignFloatingActionButton}" Name="buchungenhabenPlus" Content="{materialDesign:PackIcon Add}" Height="40" Width="40" VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="0,0,5,5" Click="BuchungenhabenPlus_Click"/>
                  <Button Style="{DynamicResource MaterialDesignFloatingActionLightButton}" Name="buchungenhabenMinus" Content="{materialDesign:PackIcon Minus}" Height="40" Width="40" VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="0,0,50,5" Click="BuchungenhabenMinus_Click"/>
                </Grid>
                <Button Grid.Row="1" Style="{DynamicResource MaterialDesignFloatingActionDarkButton}" Name="buchungensave" Height="40" Width="40" VerticalAlignment="Bottom" HorizontalAlignment="Left" Margin="5,0,0,5" Click="Buchungensave_Click">
                    <Button.ContentTemplate>
                        <DataTemplate>
                            <materialDesign:PackIcon Kind="Done" Height="25" Width="25"></materialDesign:PackIcon>
                        </DataTemplate>
                    </Button.ContentTemplate>
                </Button>
            </Grid>
        </TabItem>
      
    </TabControl>

</Window>
