-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathConfigurationWindow.xaml.cs
74 lines (60 loc) · 2.57 KB
/
ConfigurationWindow.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
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
using System;
using System.Windows;
using KinectProvider.Properties;
namespace KinectProvider
{
/// <summary>
/// Interaction logic for ConfigurationWindow.xaml
/// </summary>
/// <author>Christopher-Eyk Hrabia - www.ceh-photo.de</author>
public partial class ConfigurationWindow
{
public static readonly DependencyProperty TouchPlaneOffsetProperty =
DependencyProperty.Register("TouchPlaneOffset", typeof(int), typeof(ConfigurationWindow), new UIPropertyMetadata(350));
public static readonly DependencyProperty TouchPlaneAbsOffsetProperty =
DependencyProperty.Register("TouchPlaneAbsOffset", typeof(int), typeof(ConfigurationWindow), new UIPropertyMetadata(900));
public static readonly DependencyProperty TouchRelativeEnabledProperty =
DependencyProperty.Register("TouchRelativeEnabled", typeof(bool), typeof(ConfigurationWindow), new UIPropertyMetadata(true));
public int TouchPlaneOffset
{
get { return (int)GetValue(TouchPlaneOffsetProperty); }
set { SetValue(TouchPlaneOffsetProperty, value); }
}
public int TouchPlaneAbsOffset
{
get { return (int)GetValue(TouchPlaneAbsOffsetProperty); }
set { SetValue(TouchPlaneAbsOffsetProperty, value); }
}
public bool TouchRelativeEnabled
{
get { return (bool)GetValue(TouchRelativeEnabledProperty); }
set { SetValue(TouchRelativeEnabledProperty, value); }
}
public bool TouchAbsoluteEnabled
{
get { return !TouchRelativeEnabled; }
set { TouchRelativeEnabled = !value; }
}
public ConfigurationWindow()
{
DataContext = this;
InitializeComponent();
TouchPlaneOffset = Settings.Default.TouchPlaneOffset;
TouchPlaneAbsOffset = Settings.Default.TouchPlaneAbsOffset;
TouchRelativeEnabled = Settings.Default.TouchRelativeEnabled;
}
private void ok_Click(object sender, RoutedEventArgs e)
{
Settings.Default.TouchPlaneOffset = TouchPlaneOffset;
Settings.Default.TouchPlaneAbsOffset = TouchPlaneAbsOffset;
Settings.Default.TouchRelativeEnabled = TouchRelativeEnabled;
Settings.Default.Save();
Close();
}
private void cancel_Click(object sender, RoutedEventArgs e)
{
Close();
Settings.Default.Reload();
}
}
}