-
Notifications
You must be signed in to change notification settings - Fork 4
/
BindableNUICamera.cs
43 lines (35 loc) · 1.07 KB
/
BindableNUICamera.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
using Microsoft.Kinect;
namespace Kinect.Toolbox
{
public class BindableNUICamera : Notifier
{
readonly KinectSensor nuiCamera;
public int ElevationAngle
{
get { return nuiCamera.ElevationAngle; }
set
{
if (nuiCamera.ElevationAngle == value)
return;
if (value > ElevationMaximum)
value = ElevationMaximum;
if (value < ElevationMinimum)
value = ElevationMinimum;
nuiCamera.TrySetElevationAngle(value);
RaisePropertyChanged(() => ElevationAngle);
}
}
public int ElevationMaximum
{
get { return nuiCamera.MaxElevationAngle; }
}
public int ElevationMinimum
{
get { return nuiCamera.MinElevationAngle; }
}
public BindableNUICamera(KinectSensor nuiCamera)
{
this.nuiCamera = nuiCamera;
}
}
}