-
Notifications
You must be signed in to change notification settings - Fork 0
/
WindowHistory.xaml
148 lines (131 loc) · 9.22 KB
/
WindowHistory.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
<UserControl x:Class="InputTracker.WindowHistory"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
xmlns:local="clr-namespace:InputTracker">
<UserControl.DataContext>
<local:HistoryViewModel/>
</UserControl.DataContext>
<DockPanel>
<!-- Start, End, Content Options -->
<StackPanel DockPanel.Dock="Top" Orientation="Horizontal" Margin="0 15 0 0">
<TextBlock Text="Start" FontWeight="DemiBold"/>
<TextBlock Text="End" FontWeight="DemiBold" Margin="175 0 0 0"/>
<TextBlock Text="Content Options" FontWeight="DemiBold" Margin="175 0 0 0"/>
</StackPanel>
<!-- Calendars, Check Boxes -->
<StackPanel DockPanel.Dock="Top" Orientation="Horizontal" Margin="0 1 0 0">
<Calendar x:Name="StartCalendar" SelectedDate="{Binding StartDate}" DisplayDate="{Binding StartDate}"
DisplayDateEnd="{Binding Path=SelectedDate, ElementName=EndCalendar, UpdateSourceTrigger=PropertyChanged}"/>
<Calendar x:Name="EndCalendar" Margin="20 0 0 0" SelectedDate="{Binding EndDate}" DisplayDate="{Binding EndDate}"
DisplayDateStart="{Binding Path=SelectedDate, ElementName=StartCalendar, UpdateSourceTrigger=PropertyChanged}"/>
<!-- Check Boxes -->
<StackPanel Margin="18 0 0 0">
<CheckBox Content="Application" IsChecked="{Binding ApplicationColumn}" Margin="0 5 0 0"/>
<CheckBox Content="Window" IsChecked="{Binding WindowColumn}" Margin="0 5 0 0"/>
<CheckBox Content="Regular text" IsChecked="{Binding RegularTextColumn}" Margin="0 5 0 0"/>
<CheckBox Content="Raw text" IsChecked="{Binding RawTextColumn}" Margin="0 5 0 0"/>
<CheckBox Content="Key strokes" IsChecked="{Binding KeyStrokesColumn}" Margin="0 5 0 0"/>
<CheckBox Content="Mouse clicks" IsChecked="{Binding MouseClicksColumn}" Margin="0 5 0 0"/>
<CheckBox Content="Empty entries" IsChecked="{Binding EmptyEntries}" Margin="0 5 0 0"/>
<!-- Max Rows -->
<StackPanel Orientation="Horizontal" Margin="0 5 0 0">
<TextBlock Text="Max Rows:" FontSize="12" Margin="0 2 0 0"/>
<TextBox x:Name="MaxRows" Height="22" Padding="1 2 0 0" Text="{Binding MaxRows}" Background="{Binding MaxRowsBackground}"
Margin="5 0 0 0" Width="48">
<i:Interaction.Triggers>
<i:EventTrigger EventName="TextChanged">
<i:InvokeCommandAction Command="{Binding AdjustMaxRowsCommand}" CommandParameter="{Binding Path=Text, ElementName=MaxRows}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</TextBox>
</StackPanel>
<!-- Search, Refresh -->
<StackPanel Orientation="Horizontal" Margin="0 3 0 0">
<Image x:Name="Window" Width="38" Cursor="Hand" IsEnabled="{Binding SearchEnabled}" Source="{StaticResource Search}" Style="{StaticResource HoverEvent}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseLeftButtonDown">
<i:InvokeCommandAction Command="{Binding SearchCommand}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</Image>
<Image Margin="10 0 0 0" Width="30" Cursor="Hand" Source="{StaticResource Refresh}" Style="{StaticResource HoverEvent}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseLeftButtonDown">
<i:InvokeCommandAction Command="{Binding RefreshCommand}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</Image>
</StackPanel>
</StackPanel>
</StackPanel>
<!-- ('Start' Text Boxes), ('End' Text Boxes), (CSV, TXT) -->
<DockPanel DockPanel.Dock="Top" LastChildFill="False" Margin="0 10 0 0">
<!-- 'Start' Text Boxes -->
<StackPanel DockPanel.Dock="Left" Orientation="Horizontal" Margin="0 -38 1 0">
<TextBox x:Name="StartDate" Height="22" Padding="1 2 0 0" Width="110" IsReadOnly="True" VerticalAlignment="Top"
Text="{Binding ElementName=StartCalendar, Path=SelectedDate, StringFormat=yyyy-MM-dd, UpdateSourceTrigger=PropertyChanged}"/>
<TextBox x:Name="StartTime" Height="22" Padding="1 2 0 0" Text="{Binding StartTime}" Background="{Binding StartTimeBackground}" Margin="9 0 0 0"
Width="59" VerticalAlignment="Top">
<i:Interaction.Triggers>
<i:EventTrigger EventName="TextChanged">
<i:InvokeCommandAction Command="{Binding AdjustStartTimeCommand}" CommandParameter="{Binding Path=Text, ElementName=StartTime}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</TextBox>
</StackPanel>
<!-- 'End' Text Boxes -->
<StackPanel DockPanel.Dock="Left" Orientation="Horizontal" Margin="20 -38 1 0">
<TextBox x:Name="EndDate" Height="22" Padding="1 2 0 0" Width="110" IsReadOnly="True" VerticalAlignment="Top"
Text="{Binding ElementName=EndCalendar, Path=SelectedDate, StringFormat=yyyy-MM-dd, UpdateSourceTrigger=PropertyChanged}"/>
<TextBox x:Name="EndTime" Height="22" Padding="1 2 0 0" Text="{Binding EndTime}" Background="{Binding EndTimeBackground}" Margin="9 0 0 0"
Width="59" VerticalAlignment="Top">
<i:Interaction.Triggers>
<i:EventTrigger EventName="TextChanged">
<i:InvokeCommandAction Command="{Binding AdjustEndTimeCommand}" CommandParameter="{Binding Path=Text, ElementName=EndTime}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</TextBox>
</StackPanel>
<!-- CSV, TXT -->
<StackPanel DockPanel.Dock="Right" Orientation="Horizontal" Margin="0 -30 0 5">
<Image Width="35" Cursor="Hand" Source="{StaticResource CsvFile}" Style="{StaticResource HoverEvent}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseLeftButtonDown">
<i:InvokeCommandAction Command="{Binding GenerateCsvFileCommand}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</Image>
<Image Width="35" Cursor="Hand" Source="{StaticResource TxtFile}" Style="{StaticResource HoverEvent}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseLeftButtonDown">
<i:InvokeCommandAction Command="{Binding GenerateTxtFileCommand}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</Image>
</StackPanel>
</DockPanel>
<!-- Counters, Trash Can -->
<DockPanel DockPanel.Dock="Bottom" LastChildFill="False">
<Image DockPanel.Dock="Left" Width="20" Source="{StaticResource Database}"/>
<TextBlock DockPanel.Dock="Left" Text="{Binding Rows}" Margin="5 0 0 0" VerticalAlignment="Center"/>
<Image DockPanel.Dock="Left" Margin="15 0 0 0" Width="20" Source="{StaticResource Console}"/>
<TextBlock DockPanel.Dock="Left" Text="{Binding Applications}" Margin="5 0 0 0" VerticalAlignment="Center"/>
<Image DockPanel.Dock="Left" Margin="15 0 0 0" Width="20" Source="{StaticResource Keyboard}"/>
<TextBlock DockPanel.Dock="Left" Text="{Binding KeyStrokes}" Margin="5 0 0 0" VerticalAlignment="Center"/>
<Image DockPanel.Dock="Left" Margin="15 0 0 0" Width="20" Source="{StaticResource Mouse}"/>
<TextBlock DockPanel.Dock="Left" Text="{Binding MouseClicks}" Margin="5 0 0 0" VerticalAlignment="Center"/>
<Image DockPanel.Dock="Right" Margin="0 7 0 0" Height="30" Source="{StaticResource TrashCan2}" Style="{StaticResource HoverEvent}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseLeftButtonDown">
<i:InvokeCommandAction Command="{Binding ClearDatabaseCommand}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</Image>
</DockPanel>
<!-- Data Grid -->
<DataGrid x:Name="DatabaseDataGrid" DockPanel.Dock="Bottom" Background="White" RowBackground="#99ccff"
AlternatingRowBackground="#c2e0ff" BorderThickness="1" AreRowDetailsFrozen="True" HeadersVisibility="Column"
HorizontalScrollBarVisibility="Visible" VerticalScrollBarVisibility="Visible" SelectionMode="Extended" MaxColumnWidth="512"/>
</DockPanel>
</UserControl>