-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainWindow.xaml
307 lines (261 loc) · 16.5 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
<Window x:Class="USCISStats.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:USCISStats"
xmlns:wpf="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf"
mc:Ignorable="d"
Title="MainWindow" Height="800" Width="1500">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
</Grid.RowDefinitions>
<DockPanel Grid.Row="0" Dock="Top" >
<Menu >
<MenuItem Header="_File">
<MenuItem Header="_New" />
<MenuItem Header="_Open" />
<MenuItem Header="_Save" />
<Separator />
<MenuItem Header="_Exit" />
</MenuItem>
<MenuItem Header="_About">
<MenuItem Header="_Placeholder" />
</MenuItem>
</Menu>
</DockPanel>
<ToolBarTray Grid.Row="1" Background="AliceBlue" Grid.ColumnSpan="1" >
<ToolBar Band="1" FontSize="15" FontWeight="DemiBold" Background="AliceBlue">
<Button x:Name="BtnNewDb" Margin="10,0,10,0" Click="BtnNewDb_Click">
<StackPanel>
<Image Source="some.jpg" Stretch="None" />
<TextBlock>New Database</TextBlock>
</StackPanel>
</Button>
<Separator></Separator>
<Button x:Name="BtnOpenDb" Margin="10,0,10,0" Click="BtnOpenDatabase_Click">
<StackPanel>
<Image Source="some.jpg" Stretch="None" />
<TextBlock>Open Database</TextBlock>
</StackPanel>
</Button>
<Separator></Separator>
</ToolBar>
</ToolBarTray>
<TabControl Grid.Row="2" FontSize="13">
<TabItem Header="Table" Width="130">
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="94"></ColumnDefinition>
<ColumnDefinition Width="156"/>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0" Grid.ColumnSpan="2" Background="AliceBlue">
<StackPanel Background="AliceBlue" VerticalAlignment="Center">
<Label Height="30" Margin="0,10,0,0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" FontWeight="Bold">Get new cases from USCIS</Label>
<StackPanel Orientation="Horizontal" >
<Button x:Name="BtnNewBatch" Content="Get New Batch" Margin="10" Height="30" Width="110" HorizontalAlignment="Left" VerticalAlignment="Top" Background="#FFB9D1EA" BorderBrush="#FF707070" Padding="0" HorizontalContentAlignment="Center" Click="BtnNewBatch_Click"/>
<TextBox x:Name="TboxUscisNum" Text="USCIS Num" MinWidth="110" Height="30" MaxLength="13" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
</StackPanel>
<StackPanel Orientation="Horizontal" >
<Label Content="Cases Before:" FontWeight="Normal" Margin="10" Height="30" Width="110" Padding="0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
<TextBox x:Name="TboxCasesBefore" Text="10000" MinWidth="110" Height="30" MaxLength="5" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
</StackPanel>
<StackPanel Orientation="Horizontal" >
<Label Content="Cases After:" FontWeight="Normal" Margin="10" Height="30" Width="110" Padding="0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
<TextBox x:Name="TboxCasesAfter" Text="10000" MinWidth="110" Height="30" MaxLength="5" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
</StackPanel>
<StackPanel Orientation="Horizontal" >
<Label Content="Threads:" FontWeight="Normal" Margin="10" Height="30" Width="110" Padding="0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
<TextBox x:Name="TbThreads" Text="100" MinWidth="110" Height="30" MaxLength="3" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
</StackPanel>
</StackPanel>
</StackPanel>
<Grid Grid.Column="2" >
<Grid.RowDefinitions>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<ToolBarTray Grid.Row="0" Background="AliceBlue" IsLocked="True" >
<ToolBar Band="1" FontSize="13" Background="AliceBlue" >
<ComboBox x:Name="ComboBoxFilter" Width="110" Height="22" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" DropDownClosed="ComboBoxFilter_DropDownClosed" >
<ComboBoxItem IsSelected="True">All Cases</ComboBoxItem>
<ComboBoxItem >I-129F</ComboBoxItem>
<ComboBoxItem >I-751</ComboBoxItem>
<ComboBoxItem>I-539</ComboBoxItem>
</ComboBox>
<Separator></Separator>
<Label>Filter LastStatusChange</Label>
<TextBox x:Name="TbDateFilter" Width="100" KeyUp="TbDateFilter_KeyUp" ></TextBox>
<Separator></Separator>
<Button x:Name="BtnUpdate" IsEnabled="False" Width="120" Margin="10,0,10,0" Click="BtnUpdate_Click">
<StackPanel>
<Image Source="some.jpg" Stretch="None" />
<TextBlock>Update from USCIS</TextBlock>
</StackPanel>
</Button>
<Separator></Separator>
<Button x:Name="BtnStatistics" IsEnabled="False" Width="120" Margin="10,0,10,0" Click="BtnStatistics_Click">
<StackPanel>
<Image Source="some.jpg" Stretch="None" />
<TextBlock>Run Statistics</TextBlock>
</StackPanel>
</Button>
<Separator></Separator>
<Button x:Name="BtnSaveUpdateToDb" Width="120" Margin="0,0,0,0" Click="BtnSaveUpdateToDb_Click" IsEnabled="False">
<StackPanel Orientation="Horizontal" >
<Image Source="some.jpg" Stretch="None" />
<TextBlock Margin="10,0,10,0">Save to DB</TextBlock>
</StackPanel>
</Button>
<Separator></Separator>
<Button x:Name="BtnExportExcel" Margin="10,0,10,0" Width="120" Click="BtnExportExcel_Click" IsEnabled="False">
<StackPanel>
<Image Source="some.jpg" Stretch="None" />
<TextBlock>Export Excel</TextBlock>
</StackPanel>
</Button>
<Separator></Separator>
<Button x:Name="BtnClearView" Width="120" Margin="0,0,0,0" Click="BtnClearView_Click" IsEnabled="False">
<StackPanel Orientation="Horizontal" >
<Image Source="some.jpg" Stretch="None" />
<TextBlock Margin="10,0,10,0">Clear Table</TextBlock>
</StackPanel>
</Button>
</ToolBar>
</ToolBarTray>
<DataGrid Grid.Row="1" x:Name="DgData" CanUserSortColumns="True" EnableColumnVirtualization="True" EnableRowVirtualization="True" VerticalAlignment="Stretch" MaxHeight="2000" MaxWidth="2000" MaxColumnWidth="300" ItemsSource="{Binding Source=_listOfCasesDB}" AutoGenerateColumns="True" Sorting="Dg_Sorting" AutoGeneratingColumn="DgData_AutoGeneratingColumn" >
</DataGrid>
</Grid>
</Grid>
</TabItem>
<TabItem x:Name="TabStats" Header="Stats" Width="130">
<Grid >
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Label Grid.Row="0" Content="Statistics overview" />
<Border Grid.Row="1" BorderBrush="#C6C6C6" BorderThickness="1" >
<ScrollViewer>
<TextBox x:Name="TbStatsOverview" IsReadOnly="True" Background="GhostWhite" ></TextBox>
</ScrollViewer>
</Border>
</Grid>
</TabItem>
<TabItem Header="Processing" Width="130">
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="41*"/>
<ColumnDefinition Width="1453*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<ToolBarTray Grid.Row="0" Background="AliceBlue" IsLocked="True" Grid.ColumnSpan="2" >
<ToolBar Band="1" FontSize="13" Background="AliceBlue" >
<Label>View: </Label>
<ComboBox x:Name="TimePeriodFilter" Width="70" Height="22" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" DropDownClosed="ComboBoxFilter_DropDownClosed" >
<ComboBoxItem IsSelected="True">Year</ComboBoxItem>
<ComboBoxItem >Month</ComboBoxItem>
</ComboBox>
<Separator></Separator>
<Label>Period:</Label>
<ComboBox x:Name="PeriodFilter" Width="70" Height="22" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" DropDownClosed="ComboBoxFilter_DropDownClosed" >
<ComboBoxItem IsSelected="True">All</ComboBoxItem>
</ComboBox>
</ToolBar>
</ToolBarTray>
<wpf:CartesianChart Grid.Row="1" Zoom="Xy" Series="{Binding SeriesCollection}" LegendLocation="Top" Grid.ColumnSpan="2" Margin="0,0,0,0" Grid.RowSpan="2">
<wpf:CartesianChart.AxisX>
<wpf:Axis Title="Processed Cases"
FontSize="15"
Labels="{Binding Labels}">
<wpf:Axis.Separator>
<wpf:Separator IsEnabled="False"
Step="1">
</wpf:Separator>
</wpf:Axis.Separator>
</wpf:Axis>
</wpf:CartesianChart.AxisX>
</wpf:CartesianChart>
</Grid>
</TabItem>
<TabItem Header="Case Groups" Width="130">
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="41*"/>
<ColumnDefinition Width="1453*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<ToolBarTray Grid.Row="0"
Background="AliceBlue"
IsLocked="True"
Grid.ColumnSpan="2" >
<ToolBar Band="1"
FontSize="13"
Background="AliceBlue" >
<Label>Range</Label>
<TextBox
Width="120">Min</TextBox>
<TextBox
Width="120">Max</TextBox>
<Separator></Separator>
</ToolBar>
</ToolBarTray>
<wpf:CartesianChart Grid.Row="1" Grid.ColumnSpan="2" Zoom="Xy" ZoomingSpeed="1" Series="{Binding SeriesCollectionRowChart}" LegendLocation="Top" Margin="0,0,0,0" Grid.RowSpan="2" ScrollMode="XY">
<wpf:CartesianChart.AxisX >
<wpf:Axis Title="Salesman" LabelFormatter="{Binding Formatter}"></wpf:Axis>
</wpf:CartesianChart.AxisX>
<wpf:CartesianChart.AxisY >
<wpf:Axis Title="Sold Apps" Labels="{Binding LabelsRowChart}"></wpf:Axis>
</wpf:CartesianChart.AxisY>
<wpf:CartesianChart.DataTooltip>
<wpf:DefaultTooltip SelectionMode="SharedYValues"></wpf:DefaultTooltip>
</wpf:CartesianChart.DataTooltip>
</wpf:CartesianChart>
</Grid>
</TabItem>
</TabControl>
<DockPanel Grid.Row="4" >
<StatusBar DockPanel.Dock="Bottom">
<StatusBar.ItemsPanel>
<ItemsPanelTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="200" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="200" />
</Grid.ColumnDefinitions>
</Grid>
</ItemsPanelTemplate>
</StatusBar.ItemsPanel>
<StatusBarItem >
<Label x:Name="InternetStatus" Width="195" Content="Connecting to USCIS ..." VerticalAlignment="Top" HorizontalAlignment="Left" Height="20" Padding="0" HorizontalContentAlignment="Center"/>
</StatusBarItem>
<Separator Grid.Column="1" />
<StatusBarItem Grid.Column="2">
<TextBlock x:Name="TbInfoBlock" Text="Cases in Table: 0" />
</StatusBarItem>
<Separator Grid.Column="3" />
<StatusBarItem Grid.Column="4">
<Grid>
<ProgressBar x:Name="PbStatus" Minimum="0" Value="0" Width="190" Height="16" />
<TextBlock x:Name="TxtBlkStatus" Text="Idle" TextAlignment="Center"></TextBlock>
</Grid>
</StatusBarItem>
</StatusBar>
</DockPanel>
</Grid>
</Window>