-
Notifications
You must be signed in to change notification settings - Fork 0
/
WindowMain.xaml.cs
35 lines (27 loc) · 1.2 KB
/
WindowMain.xaml.cs
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
using System.Reflection;
namespace InputTracker;
public partial class WindowMain : Window {
public static new string Title = "Input Tracker";
// Windows
private readonly WindowOverview _windowOverview = new WindowOverview();
private readonly WindowLive _windowLive = new WindowLive();
private readonly WindowHistory _windowHistory = new WindowHistory();
public WindowMain() {
InitializeComponent();
// Adding windows to Grid, setting visibility
WindowGrid.Children.Add(_windowOverview);
WindowGrid.Children.Add(_windowLive);
WindowGrid.Children.Add(_windowHistory);
WindowGrid.Children[WindowIndex.Live].Visibility = Visibility.Hidden;
WindowGrid.Children[WindowIndex.History].Visibility = Visibility.Hidden;
DataContext = new MainViewModel(WindowGrid);
// Disable keys functions on main window
this.PreviewKeyDown += _Window_PreviewKeyDown;
RenderOptions.ProcessRenderMode = RenderMode.SoftwareOnly;
}
private void _Window_PreviewKeyDown(object sender, KeyEventArgs e) {
if (new Key[] { Key.Tab, Key.Space, Key.Enter }.Contains(e.Key)) {
e.Handled = true;
}
}
}