-
Notifications
You must be signed in to change notification settings - Fork 1
/
MainWindow.xaml
101 lines (87 loc) · 6.32 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
<Window x:Class="ThothTrainer.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:ThothTrainer"
mc:Ignorable="d"
xmlns:WinFormControls="clr-namespace:Emgu.CV.UI;assembly=Emgu.CV.UI"
xmlns:WinFormHost="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
Name="ThothTrainer"
Title="Thoth Trainer" Height="600" Width="800" ResizeMode="NoResize"
DragEnter="Window_DragEnter" Drop="Window_Drop" DragOver="Window_DragEnter" DragLeave="Window_DragLeave"
AllowDrop="True" WindowStyle="SingleBorderWindow">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="340"/>
<RowDefinition Height="40"/>
<RowDefinition Height="70"/>
<RowDefinition Height="16*"/>
<RowDefinition Height="28"/>
</Grid.RowDefinitions>
<StackPanel Margin="10,10" Orientation="Horizontal">
<WindowsFormsHost x:Name="WinformHost" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="0,0,0,0" Width="425" Height="320" ScrollViewer.VerticalScrollBarVisibility="Disabled" ScrollViewer.CanContentScroll="True">
<WinFormControls:ImageBox x:Name="CameraImageBox" Margin="0,0,0,0" FunctionalMode="Minimum" SizeMode="StretchImage" Click="CameraImageBox_Click" />
</WindowsFormsHost>
<ListBox Margin="5" Width="330" Name="PictureList">
<ListBox.Template>
<ControlTemplate TargetType="{x:Type ListBox}">
<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
<WrapPanel Orientation="Horizontal" IsItemsHost="True" ScrollViewer.CanContentScroll="True"/>
</ScrollViewer>
</ControlTemplate>
</ListBox.Template>
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel>
<Image Source="{Binding DisplayImage}" Width="100" Height="100" VerticalAlignment="Top" MouseRightButtonUp="RemovePicture_Click" />
<TextBox Width="100" Text="{Binding DisplayName}" TextAlignment="Center" Focusable="False" BorderBrush="{x:Null}" />
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</StackPanel>
<StackPanel HorizontalAlignment="Left" Orientation="Horizontal" Grid.Row="1" Margin="10,0" VerticalAlignment="Top">
<Button Width="425" Height="40" Margin="0" Name="TakePictures" Click="TakePictures_Click">Take your photo from camera</Button>
<Button HorizontalAlignment="Right" Margin="10,0,0,0" Content="Choose photos" Width="135" Height="40" Name="ChoosePictures" Click="ChoosePictures_Click" />
<Button HorizontalAlignment="Right" Margin="10,0,0,0" Content="Reset all" Width="180" Height="40" Name="ResetPictures" Click="ResetPictures_Click" />
</StackPanel>
<StackPanel HorizontalAlignment="Left" Orientation="Horizontal" Grid.Row="2" Margin="10,5,0,0" VerticalAlignment="Top">
<StackPanel Width="425" Orientation="Vertical" Margin="0,0,10,0">
<StackPanel Width="425" Margin="5" Orientation="Horizontal">
<Label Width="50" Padding="2" Foreground="#FFC71D1D" FontWeight="Bold">Name:</Label>
<TextBox Text="" Margin="0" Width="140" Name="NameTextBox" LostFocus="NameTextBox_LostFocus" KeyUp="NameTextBox_KeyUp" MouseDoubleClick="NameTextBox_MouseDoubleClick" />
<Label Width="60" Padding="5,2">Email:</Label>
<TextBox Text="" Margin="0" Width="155" Name="EmailTextBox" />
</StackPanel>
<StackPanel Width="425" Margin="5" Orientation="Horizontal">
<Label Width="50" Padding="2">Identity:</Label>
<TextBox Text="" Margin="0" Width="100" Name="IdentityTextBox" IsReadOnly="True" Focusable="False" Background="{x:Null}" SelectionBrush="{x:Null}" BorderBrush="{x:Null}" BorderThickness="0" />
<Button Width="90" Margin="5,0" Name="ResetFormOnly" Click="ResetFormOnly_Click">Clear selection</Button>
<Button Width="90" Margin="5,0" Name="DeletePicOnly" Foreground="#FFC91010" Click="DeletePicOnly_Click">Delete pictures</Button>
<Button Width="50" Margin="5,0" Name="DeleteSelectedUser" Foreground="#FFC91010" Click="DeleteSelectedUser_Click">Delete</Button>
</StackPanel>
</StackPanel>
<Button Height="60" Width="135" FontSize="16" Name="Search" Margin="0,0,10,0" Click="Search_Click">Search</Button>
<Button Height="60" Width="180" FontSize="16" Name="SubmitAndTrain" Margin="0" Click="SubmitAndTrain_Click">Save and train</Button>
</StackPanel>
<ListBox Margin="10,0" Grid.Row="3" Name="SearchResult" Width="780">
<ListBox.Template>
<ControlTemplate TargetType="{x:Type ListBox}">
<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
<StackPanel Orientation="Horizontal" IsItemsHost="True" ScrollViewer.CanContentScroll="True"/>
</ScrollViewer>
</ControlTemplate>
</ListBox.Template>
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel ToolTip="{Binding Path=DisplayFaceCount}">
<Image Source="{Binding Path=DisplayImage}" Width="60" Height="60" VerticalAlignment="Top" />
<TextBox Width="60" Text="{Binding Path=Name}" TextAlignment="Center" Focusable="False" BorderBrush="{x:Null}" />
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<Label x:Name="StatusBar" Content="" Height="28" Margin="0,0,0,0" Grid.Row="4" VerticalAlignment="Bottom"/>
</Grid>
</Window>