PageRenderTime 192ms CodeModel.GetById 100ms app.highlight 2ms RepoModel.GetById 89ms app.codeStats 0ms

/TimeSheetReporting/TimeSheetReporting/Views/Home.xaml

#
XAML | 87 lines | 83 code | 4 blank | 0 comment | 0 complexity | a857cef5e9438e72f50d9804b9a9f2be MD5 | raw file
 1<navigation:Page x:Class="TimeSheetReporting.Home" 
 2    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
 3    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
 4    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
 5    xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
 6    xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
 7    xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
 8    xmlns:riaControl="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Ria"
 9    xmlns:src="clr-namespace:TimeSheetReporting.Helper"
10    mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480"
11    Title="Home"
12    Style="{StaticResource PageStyle}">
13
14  <Grid x:Name="LayoutRoot">
15    <Grid.Resources>
16      <src:MemberListProvider x:Key="memberListProvider" />
17      <src:ProjectListProvider x:Key="projectListProvider" />
18    </Grid.Resources>
19    <Border Style="{StaticResource ContentBoxStyle}">
20      <Grid>
21        <data:DataGrid x:Name="gridEfforts" AutoGenerateColumns="False" Margin="0,0,0,30" >
22          <data:DataGrid.Columns>
23            <data:DataGridTemplateColumn Header="Date">
24              <data:DataGridTemplateColumn.CellTemplate>
25                <DataTemplate>
26                  <controls:DatePicker  SelectedDate="{Binding Date,Mode=TwoWay}"/>
27                </DataTemplate>
28              </data:DataGridTemplateColumn.CellTemplate>
29            </data:DataGridTemplateColumn>
30            <data:DataGridTemplateColumn Header="Member">
31              <data:DataGridTemplateColumn.CellTemplate>
32                <DataTemplate>
33                  <TextBlock Text="{Binding Member.Name}" />
34                </DataTemplate>
35              </data:DataGridTemplateColumn.CellTemplate>
36              <data:DataGridTemplateColumn.CellEditingTemplate>
37                <DataTemplate>
38                  <ComboBox ItemsSource="{Binding MemberList,Source={StaticResource memberListProvider}}" 
39                            SelectedItem="{Binding Member,Mode=TwoWay}"
40                            DisplayMemberPath="Name" />
41                </DataTemplate>
42              </data:DataGridTemplateColumn.CellEditingTemplate>
43            </data:DataGridTemplateColumn>
44            <data:DataGridTemplateColumn Header="Project" >
45              <data:DataGridTemplateColumn.CellTemplate>
46                <DataTemplate>
47                  <TextBlock Text="{Binding Project.Name}" />
48                </DataTemplate>
49              </data:DataGridTemplateColumn.CellTemplate>
50              <data:DataGridTemplateColumn.CellEditingTemplate>
51                <DataTemplate>
52                  <ComboBox ItemsSource="{Binding ProjectList,Source={StaticResource projectListProvider}}"
53                            SelectedItem="{Binding Project,Mode=TwoWay}"
54                            DisplayMemberPath="Name" />
55                </DataTemplate>
56              </data:DataGridTemplateColumn.CellEditingTemplate>
57            </data:DataGridTemplateColumn>
58            <data:DataGridTemplateColumn Header="Hours">
59              <data:DataGridTemplateColumn.CellTemplate >
60                <DataTemplate>
61                  <TextBox Text="{Binding Hours,Mode=TwoWay}"/>
62                </DataTemplate>
63              </data:DataGridTemplateColumn.CellTemplate>
64            </data:DataGridTemplateColumn>
65            <data:DataGridTemplateColumn Header="Description">
66              <data:DataGridTemplateColumn.CellTemplate >
67                <DataTemplate>
68                  <TextBox Text="{Binding Description,Mode=TwoWay}"/>
69                </DataTemplate>
70              </data:DataGridTemplateColumn.CellTemplate>
71            </data:DataGridTemplateColumn>
72          </data:DataGrid.Columns>
73        </data:DataGrid>
74      </Grid>
75    </Border>
76
77
78    <Border Style="{StaticResource ToolBoxStyle}">
79      <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center" >
80        <Button x:Name="BtnSave" Content="Save" Margin="5,0,0,0" Style="{StaticResource BtnSaveStyle}"  Click="BtnSave_Click" />
81        <Button x:Name="BtnAdd" Content="Add" Margin="5,0,0,0" Style="{StaticResource BtnAddStyle}" Click="BtnAdd_Click"/>
82        <Button x:Name="BtnDelete" Content="Delete" Margin="5,0,0,0" Style="{StaticResource BtnDeleteStyle}" Click="BtnDelete_Click"/>
83      </StackPanel>
84    </Border>
85  </Grid>
86
87</navigation:Page>