<commit_before>﻿<UserControl x:Class="MoneyEntry.View.NewMoneyEntryView"
             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:vm="clr-namespace:MoneyEntry.ViewModel"
             xmlns:w="clr-namespace:System.Windows.Controls;assembly=PresentationFramework"
             mc:Ignorable="d" 
             Background="Black">
    <UserControl.Resources>
        <ResourceDictionary Source="..\MainWindowResources.xaml" />
    </UserControl.Resources>
    <Grid>
        <DockPanel>
            <Border DockPanel.Dock="Top">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>
                    
                    <StackPanel Grid.Column="0">
                        <Label Content="Entry Date:" HorizontalContentAlignment="Stretch" />
                    <Border>
                            <DatePicker Margin="10" Foreground="{StaticResource FontBrush}" FontSize="20" SelectedDate="{Binding DateEntry}" HorizontalContentAlignment="Stretch"/>
                    </Border>
                        <Label Content="Type of Transaction: " HorizontalContentAlignment="Stretch"/>
                    <Border>
                        <ComboBox x:Name="comboType" Margin="10" ItemsSource="{Binding Types}" DisplayMemberPath="TypeName" SelectedValue="{Binding CurrentType}"
                                  HorizontalContentAlignment="Stretch" />
                    </Border>
                </StackPanel>

                    <StackPanel Grid.Column="1">
                    <Label Content="Amount: "  HorizontalAlignment="Center"/>
                    <Border>
                        <TextBox x:Name="txtMoney" Text="{Binding Path=MoneyAmount}"  Margin="16" />
                    </Border>                        
                    <Label Content="Category of Transaction: " Foreground="{StaticResource FontBrush}" HorizontalAlignment="Center"/>
                    <Border>
                        <ComboBox x:Name="comboCategory" Margin="10" ItemsSource="{Binding Categories}" DisplayMemberPath="CategoryName" SelectedValuePath="CategoryName" SelectedValue="{Binding CurrentCategory}" />
                    </Border>
                </StackPanel>

                    <StackPanel Grid.Column="2">
                    <Label Content="Description: " HorizontalAlignment="Center"/>
                    <Border>
                            <TextBox x:Name="txtDesc" Text="{Binding Path=Desc}" Margin="16"/>
                    </Border>
                    <Button x:Name="butSubmit" Content="Submit" Style="{StaticResource GlassButton}" Command="{Binding Path=SaveCommand}" Margin="16" />
                    </StackPanel>

                </Grid>
            </Border>

            <Border DockPanel.Dock="Top" Margin="0,50,0,0" >
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="*" />
                    </Grid.RowDefinitions>
                        <StackPanel Grid.Row="0" Grid.Column="0">
                            <Label Content="StartDate: " HorizontalAlignment="Center"/>
                            <Border>
                            <DatePicker x:Name="calStartDate" Margin="10" Foreground="{StaticResource FontBrush}" FontSize="20" SelectedDate="{Binding RefreshStart}" />
                        </Border>
                        </StackPanel>

                    <StackPanel Grid.Row="0" Grid.Column="1" >
                            <Label Content="EndDate: " HorizontalAlignment="Center"/>
                            <Border>
                                <DatePicker Margin="10" Foreground="{StaticResource FontBrush}" FontSize="20" SelectedDate="{Binding RefreshEnd}"  />
                            </Border>
                        </StackPanel>
                    <Button Grid.Row="0" Grid.Column="2" Content="Refresh"  Style="{StaticResource GlassButton}" Command="{Binding Path=RefreshCommand}" Margin="30"  />
                </Grid>
            </Border>

            <DataGrid DockPanel.Dock="Top" x:Name="datagrid" 
                              ItemsSource="{Binding MoneyEnts}"                   
                              AutoGenerateColumns="False" 
                              HorizontalAlignment="Left" 
                              VerticalAlignment="Top" 
                              IsSynchronizedWithCurrentItem="True"
                              MaxHeight="400"
                              >
                <DataGrid.Columns>
                    <DataGridTextColumn Header="TransactionId" Binding="{Binding TransactionId}" CanUserReorder="True"/>
                    <DataGridTextColumn Header="EntryDate" Binding="{Binding CreatedDate, StringFormat={}{0:M/d/yyyy}}" CanUserReorder="True"/>
                    <DataGridTextColumn Header="Description" Binding="{Binding TransactionDesc}" />
                    <DataGridTextColumn Header="TypeName" Binding="{Binding Type}"/>
                    <DataGridTextColumn Header="CategoryName" Binding="{Binding Category}" CanUserReorder="True"/>
                    <DataGridTextColumn Header="Amount" Binding="{Binding Amount, StringFormat={}{0:#.00}}"  />
                    <DataGridTextColumn Header="RunningTotal" Binding="{Binding RunningTotal, StringFormat={}{0:#.00}}" />
                    <DataGridCheckBoxColumn Header="IsReconciled" Binding="{Binding Reconciled}" CanUserReorder="True"/>
                </DataGrid.Columns>
            </DataGrid>
        </DockPanel>
    </Grid>
</UserControl>
<commit_msg>Keeping entry for posterity purposes of datagrid combobox binding<commit_after>﻿<UserControl x:Class="MoneyEntry.View.NewMoneyEntryView"
             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:vm="clr-namespace:MoneyEntry.ViewModel"
             xmlns:w="clr-namespace:System.Windows.Controls;assembly=PresentationFramework"
             mc:Ignorable="d" 
             Background="Black">
    <UserControl.Resources>
    <ResourceDictionary>
      <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="pack://application:,,,/MoneyEntry;component/MainWindowResources.xaml"/>
      </ResourceDictionary.MergedDictionaries>
      <CollectionViewSource x:Key="Types" Source="{Binding Types}"/>
    </ResourceDictionary>
  </UserControl.Resources>
    <Grid>
        <DockPanel>
            <Border DockPanel.Dock="Top">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>
                    
                    <StackPanel Grid.Column="0">
                        <Label Content="Entry Date:" HorizontalContentAlignment="Stretch" />
                    <Border>
                            <DatePicker Margin="10" Foreground="{StaticResource FontBrush}" FontSize="20" SelectedDate="{Binding DateEntry}" HorizontalContentAlignment="Stretch"/>
                    </Border>
                        <Label Content="Type of Transaction: " HorizontalContentAlignment="Stretch"/>
                    <Border>
                        <ComboBox x:Name="comboType" Margin="10" ItemsSource="{Binding Types}" DisplayMemberPath="TypeName" SelectedValue="{Binding CurrentType}"
                                  HorizontalContentAlignment="Stretch" />
                    </Border>
                </StackPanel>

                    <StackPanel Grid.Column="1">
                    <Label Content="Amount: "  HorizontalAlignment="Center"/>
                    <Border>
                        <TextBox x:Name="txtMoney" Text="{Binding Path=MoneyAmount}"  Margin="16" />
                    </Border>                        
                    <Label Content="Category of Transaction: " Foreground="{StaticResource FontBrush}" HorizontalAlignment="Center"/>
                    <Border>
                        <ComboBox x:Name="comboCategory" Margin="10" ItemsSource="{Binding Categories}" DisplayMemberPath="CategoryName" SelectedValuePath="CategoryName" SelectedValue="{Binding CurrentCategory}" />
                    </Border>
                </StackPanel>

                    <StackPanel Grid.Column="2">
                    <Label Content="Description: " HorizontalAlignment="Center"/>
                    <Border>
                            <TextBox x:Name="txtDesc" Text="{Binding Path=Desc}" Margin="16"/>
                    </Border>
                    <Button x:Name="butSubmit" Content="Submit" Style="{StaticResource GlassButton}" Command="{Binding Path=SaveCommand}" Margin="16" />
                    </StackPanel>

                </Grid>
            </Border>

            <Border DockPanel.Dock="Top" Margin="0,50,0,0" >
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="*" />
                    </Grid.RowDefinitions>
                        <StackPanel Grid.Row="0" Grid.Column="0">
                            <Label Content="StartDate: " HorizontalAlignment="Center"/>
                            <Border>
                            <DatePicker x:Name="calStartDate" Margin="10" Foreground="{StaticResource FontBrush}" FontSize="20" SelectedDate="{Binding RefreshStart}" />
                        </Border>
                        </StackPanel>

                    <StackPanel Grid.Row="0" Grid.Column="1" >
                            <Label Content="EndDate: " HorizontalAlignment="Center"/>
                            <Border>
                                <DatePicker Margin="10" Foreground="{StaticResource FontBrush}" FontSize="20" SelectedDate="{Binding RefreshEnd}"  />
                            </Border>
                        </StackPanel>
                    <Button Grid.Row="0" Grid.Column="2" Content="Refresh"  Style="{StaticResource GlassButton}" Command="{Binding Path=RefreshCommand}" Margin="30"  />
                </Grid>
            </Border>

            <DataGrid DockPanel.Dock="Top" x:Name="datagrid" 
                              ItemsSource="{Binding MoneyEnts}"                   
                              AutoGenerateColumns="False" 
                              HorizontalAlignment="Left" 
                              VerticalAlignment="Top" 
                              IsSynchronizedWithCurrentItem="True"
                              MaxHeight="400"
                              >
                <DataGrid.Columns>
                    <DataGridTextColumn Header="TransactionId" Binding="{Binding TransactionId}" CanUserReorder="True"/>
                    <DataGridTextColumn Header="EntryDate" Binding="{Binding CreatedDate, StringFormat={}{0:M/d/yyyy}}" CanUserReorder="True"/>
                    <DataGridTextColumn Header="Description" Binding="{Binding TransactionDesc}" />
                    <!--<DataGridTextColumn Header="TypeName" Binding="{Binding Type}"/>-->
          <DataGridComboBoxColumn Header="Type" ItemsSource="{Binding Source={StaticResource Types}}" DisplayMemberPath="TypeName" SelectedValueBinding="{Binding Type}" />
                    <DataGridTextColumn Header="CategoryName" Binding="{Binding Category}" CanUserReorder="True"/>
                    <DataGridTextColumn Header="Amount" Binding="{Binding Amount, StringFormat={}{0:#.00}}"  />
                    <DataGridTextColumn Header="RunningTotal" Binding="{Binding RunningTotal, StringFormat={}{0:#.00}}" />
                    <DataGridCheckBoxColumn Header="IsReconciled" Binding="{Binding Reconciled}" CanUserReorder="True"/>
                </DataGrid.Columns>
            </DataGrid>
        </DockPanel>
    </Grid>
</UserControl>

{'fraction_non_alphanumeric': 0.11989600856400061, 'fraction_numerical': 0.009787429270530662, 'mean_word_length': 1.6944787803873094, 'pattern_counts': {'":': 0, '<': 176, '<?xml version=': 0, '>': 176, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 14}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5506862', 'n_tokens_mistral': 3274, 'n_tokens_neox': 2863, 'n_words': 486}