-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainWindow.xaml
115 lines (96 loc) · 5.73 KB
/
MainWindow.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<Window x:Class="DYA.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:DYA"
xmlns:ui="http://schemas.modernwpf.com/2019"
ui:WindowHelper.UseModernWindowStyle="True"
xmlns:converters="clr-namespace:DYA.Converters"
mc:Ignorable="d"
Title="DoYourAssignments" Height="450" Width="800" MinHeight="450" MinWidth="800">
<Window.Resources>
<converters:AssignmentConverter x:Key="AssignmentConverter"/>
<!--<converters:VisibilityConverter x:Key="VisibilityConverter"/>
<DataTemplate x:Key="ExpandDetails">
<ToggleButton x:Name="ShowDetails"
IsChecked="{Binding RelativeSource={RelativeSource AncestorType=DataGridRow},
Path=DetailsVisibility,
Converter={StaticResource VisibilityConverter},
Mode=TwoWay}"/>
</DataTemplate>-->
</Window.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!--View Panel-->
<Grid Grid.Column="0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock Text="View Panel" Grid.Row="0"/>
<DataGrid x:Name="Assignments" ItemsSource="{Binding}" AutoGenerateColumns="False" CanUserAddRows="False" Grid.Row="1">
<DataGrid.Columns>
<DataGridTextColumn Header="ID" Binding="{Binding ID}" IsReadOnly="True" Width="Auto"/>
<DataGridTextColumn Header="Name" Binding="{Binding Name}" IsReadOnly="True" Width="*"/>
<DataGridTextColumn Header="Current Points" Binding="{Binding CurrentPoints}" IsReadOnly="True" Width="*"/>
<DataGridTextColumn Header="Max Points" Binding="{Binding MaxPoints}" IsReadOnly="True" Width="*"/>
<DataGridTextColumn Header="Percentage (%)" Binding="{Binding PercentagePoints}" IsReadOnly="True" Width="*"/>
</DataGrid.Columns>
<DataGrid.RowDetailsTemplate>
<DataTemplate>
<Border BorderThickness="5">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0">
<!--Info-->
<StackPanel Orientation="Horizontal">
<TextBlock Text="Class: "/>
<TextBlock Text="{Binding ClassName}"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Weeks: "/>
<TextBlock Text="{Binding Weekcount}"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Next Due: "/>
<TextBlock Text="{Binding NextDueTime}"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Goal reached?: "/>
<TextBlock Text="{Binding GoalReached}"/>
</StackPanel>
</StackPanel>
<!--Assignments-->
<DataGrid x:Name="ViewPanel"
ItemsSource="{Binding Assignments}"
CanUserAddRows="False"
AutoGenerateColumns="False"
Grid.Column="1">
<DataGrid.Columns>
<DataGridTextColumn Header="Week" Binding="{Binding Week}" IsReadOnly="True"/>
<!--TODO: add DatePicker for editing-->
<DataGridTextColumn Header="Due Time" Binding="{Binding DueTime}"/>
<DataGridCheckBoxColumn Header="Submitted" Binding="{Binding Submitted}"/>
<DataGridTextColumn Header="Reached Points" Binding="{Binding PointsReached}"/>
<DataGridTextColumn Header="Max Points" Binding="{Binding PointsMax}"/>
<DataGridTextColumn Header="Percentage (%)" Binding="{Binding PointsPercentage}" IsReadOnly="True"/>
</DataGrid.Columns>
</DataGrid>
</Grid>
</Border>
</DataTemplate>
</DataGrid.RowDetailsTemplate>
</DataGrid>
</Grid>
<!--Saving/Settings Panel-->
<StackPanel Grid.Row="1">
</StackPanel>
</Grid>
</Window>