Commit 78033b5

mo khan <mo@mokhan.ca>
2011-03-28 19:01:14
start clean up for xaml for tax summary tab.
1 parent 25b10c4
product/desktop.ui/model/TaxesForIndividual.cs
@@ -1,4 +1,5 @@
 using System;
+using System.Collections.Generic;
 
 namespace solidware.financials.windows.ui.model
 {
@@ -7,11 +8,25 @@ namespace solidware.financials.windows.ui.model
         public TaxesForIndividual(Guid id)
         {
             Id = id;
+            ProvincialTaxesGrid = new List<TaxRow>
+                                  {
+                                      new TaxRow {Name = "john doe", Tax = 23456.09m},
+                                      new TaxRow {Name = "sally doe", Tax = 9456.09m},
+                                  };
+            FederalTaxesGrid = new List<TaxRow>
+                               {
+                                   new TaxRow {Name = "john doe", Tax = 23456.09m},
+                                   new TaxRow {Name = "sally doe", Tax = 9456.09m},
+                               };
         }
 
         public Guid Id { get; private set; }
         public decimal TotalIncome { get; private set; }
+        public decimal TotalFamilyIncome { get; private set; }
         public decimal FederalTaxes { get; private set; }
+        public decimal FederalFamilyTaxes { get; private set; }
+        public IEnumerable<TaxRow> ProvincialTaxesGrid { get; private set; }
+        public IEnumerable<TaxRow> FederalTaxesGrid { get; private set; }
 
         public void AddIncome(decimal amount)
         {
@@ -19,6 +34,11 @@ namespace solidware.financials.windows.ui.model
             FederalTaxes = new FederalTaxes().CalculateFederalTaxesFor(TotalIncome);
             update(x => x.FederalTaxes, x => x.TotalIncome);
         }
+    }
 
+    public class TaxRow
+    {
+        public string Name { get; set; }
+        public decimal Tax { get; set; }
     }
 }
\ No newline at end of file
product/desktop.ui/views/Shell.xaml
@@ -1,6 +1,6 @@
 <Window x:Class="solidware.financials.windows.ui.views.Shell"
   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
-  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:ad="clr-namespace:AvalonDock;assembly=AvalonDock" xmlns:views="clr-namespace:solidware.financials.windows.ui.views" Title="MoMoney - (ALPHA)" MinWidth="1024" MinHeight="768" WindowStartupLocation="CenterScreen" WindowState="Maximized">
+  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:ad="clr-namespace:AvalonDock;assembly=AvalonDock" xmlns:views="clr-namespace:solidware.financials.windows.ui.views" Title="Family Finances - (ALPHA)" MinWidth="1024" MinHeight="768" WindowStartupLocation="CenterScreen" WindowState="Maximized">
   <Grid>
     <Grid.RowDefinitions>
       <RowDefinition Height="24"/>
product/desktop.ui/views/TaxSummaryTab.xaml
@@ -4,23 +4,64 @@
              xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
              xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
              mc:Ignorable="d" >
-    <StackPanel>
+    <DockPanel MinWidth="1024">
         <StackPanel DataContext="{Binding Path=Selected}">
-            <Label>Total Income:</Label>
-            <Label Content="{Binding Path=TotalIncome}"></Label>
-            <Label>Federal Tax Rates for 2011</Label>
-            <ListView>
-                <ListViewItem> * 15% on the first $41,544 of taxable income, + </ListViewItem>
-                <ListViewItem> * 22% on the next $41,544 of taxable income (on the portion of taxable income between $41,544 and $83,088), + </ListViewItem>
-                <ListViewItem> * 26% on the next $45,712 of taxable income (on the portion of taxable income between $83,088 and $128,800), + </ListViewItem>
-                <ListViewItem> * 29% of taxable income over $128,800. </ListViewItem>
-            </ListView>
-            <Label>Federal Taxes:</Label>
-            <Label Content="{Binding Path=FederalTaxes}"></Label>
-            <Label>Provincial Tax Rates for 2011</Label>
-            <ListView>
-                <ListViewItem> * 10% of taxable income </ListViewItem>
-            </ListView>
+            <StackPanel Margin="5,5,5,5">
+            <Label FontWeight="Bold">Income</Label>
+            <DockPanel>
+                <Label Width="100">Individual:</Label>
+                <Label Content="{Binding Path=TotalIncome}" FontWeight="Bold"></Label>
+            </DockPanel>
+            <DockPanel>
+                <Label Width="100">Family:</Label>
+                <Label Content="{Binding Path=TotalFamilyIncome}" FontWeight="Bold"></Label>
+            </DockPanel>
+            </StackPanel>
+            <DockPanel LastChildFill="False" HorizontalAlignment="Stretch">
+            <StackPanel Margin="5,5,5,5" Width="500">
+                <Label FontWeight="Bold">Federal Taxes</Label>
+                <Expander Header="Tax Rates">
+                <StackPanel>
+                <Label FontSize="10" FontWeight="Bold">Federal Tax Rates for 2011</Label>
+                <ListView FontSize="10">
+                    <ListViewItem> * 15% on the first $41,544 of taxable income, + </ListViewItem>
+                    <ListViewItem> * 22% on the next $41,544 of taxable income (on the portion of taxable income between $41,544 and $83,088), + </ListViewItem>
+                    <ListViewItem> * 26% on the next $45,712 of taxable income (on the portion of taxable income between $83,088 and $128,800), + </ListViewItem>
+                    <ListViewItem> * 29% of taxable income over $128,800. </ListViewItem>
+                </ListView>
+                </StackPanel>
+                </Expander>
+                <DockPanel>
+                    <Label Width="100">Individual:</Label>
+                    <Label Content="{Binding Path=FederalTaxes}" FontWeight="Bold"/>
+                </DockPanel>
+                <DockPanel>
+                    <Label Width="100">Family:</Label>
+                    <Label Content="{Binding Path=FederalFamilyTaxes}" FontWeight="Bold"/>
+                </DockPanel>
+                <DataGrid Margin="5,5,5,5" ItemsSource="{Binding FederalTaxesGrid, Mode=OneWay}" IsReadOnly="True"></DataGrid>
+            </StackPanel>
+            <StackPanel Margin="5,5,5,5" Width="500">
+                <Label FontWeight="Bold">Provincial Taxes</Label>
+                <Expander Header="Provincial Tax Rates">
+                    <StackPanel>
+                    <Label FontSize="10" FontWeight="Bold">Provincial Tax Rates for 2011</Label>
+                    <ListView FontSize="10">
+                        <ListViewItem> * 10% of taxable income </ListViewItem>
+                    </ListView>
+                    </StackPanel>
+                </Expander>
+                <DockPanel>
+                    <Label Width="100">Individual:</Label>
+                    <Label Content="{Binding Path=ProvincialTaxes}" FontWeight="Bold"/>
+                </DockPanel>
+                <DockPanel>
+                    <Label Width="100">Family:</Label>
+                    <Label Content="{Binding Path=FamilyProvincialTaxes}" FontWeight="Bold"/>
+                </DockPanel>
+                <DataGrid Margin="5,5,5,5" ItemsSource="{Binding ProvincialTaxesGrid, Mode=OneWay}" IsReadOnly="true"></DataGrid>
+            </StackPanel>
+            </DockPanel>
         </StackPanel>
-    </StackPanel>
+    </DockPanel>
 </UserControl>
product/desktop.ui/solidware.financials.csproj
@@ -32,7 +32,7 @@
     <BootstrapperEnabled>true</BootstrapperEnabled>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
-    <PlatformTarget>x86</PlatformTarget>
+    <PlatformTarget>AnyCPU</PlatformTarget>
     <DebugSymbols>true</DebugSymbols>
     <DebugType>full</DebugType>
     <Optimize>false</Optimize>
product/utility/utility.csproj
@@ -47,7 +47,9 @@
     <Compile Include="MapperRegistery.cs" />
     <Compile Include="NeedsShutdown.cs" />
     <Compile Include="NeedStartup.cs" />
-    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <Folder Include="Properties\" />
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
support/default.build
@@ -43,7 +43,7 @@
     <property name="publish.url" value="${tmp.dir}\public\" />
     <property name="update.url" value="${publish.url}" />
     <property name="publish.dir" value="${publish.url}" />
-    <property name="product.name" value="More Money (LOCAL)" />
+    <property name="product.name" value="Family Finances (LOCAL)" />
     <property name="publisher.name" value="SolidWare Inc." />
     <call target="_publish.installer" />
   </target>
@@ -60,29 +60,28 @@
     <property name="publish.url" value="http://mokhan.ca/downloads/apps/momoney/" />
     <property name="update.url" value="${publish.url}" />
     <property name="publish.dir" value="${tmp.dir}\public\" />
-    <property name="product.name" value="More Money" />
+    <property name="product.name" value="Family Finances" />
     <property name="publisher.name" value="SolidWare Inc." />
     <call target="_publish.installer" />
   </target>
 
-	<target name="run.test" depends="compile">
-  	<!-- <property name="xunit.cons.exe" value="${tools.dir}/mspec/mspec.exe" /> -->
+  <target name="run.test" depends="compile">
     <property name="xunit.cons.exe" value="${base.dir}/packages/Machine.Specifications.0.4.9.0/tools/mspec-clr4.exe" />
-		<exec program="${xunit.cons.exe}" workingdir="${tmp.dir}" commandline="${xunit.arguments}" />
-	</target>
+    <exec program="${xunit.cons.exe}" workingdir="${tmp.dir}" commandline="${xunit.arguments}" />
+  </target>
 
-	<target name="test">
-		<property name="xunit.arguments" value="-t --html ${tmp.dir} ${tmp.dir}/specs.dll" />
-		<call target="run.test" />
-	</target>
+  <target name="test">
+    <property name="xunit.arguments" value="-t --html ${tmp.dir} ${tmp.dir}/specs.dll" />
+    <call target="run.test" />
+  </target>
 
-	<target name="expand.template.file">
-		<copy file="${target}.template" tofile="${target}" overwrite="true">
+  <target name="expand.template.file">
+    <copy file="${target}.template" tofile="${target}" overwrite="true">
       <filterchain>
-        <expandproperties />
+	<expandproperties />
       </filterchain>
-		</copy>
-	</target>
+    </copy>
+  </target>
 
   <target name="create.configs">
     <property name="target" value="${src.dir}/desktop.ui/Properties/AssemblyInfo.cs" />