public MotionTrackingTouchDevice(HandPointEventArgs e, Window window, MotionTrackingScreen screen)
            : base(e.Id)
        {
            lastEventArgs = e;

            if (window == null)
                throw new ArgumentNullException("window");
            if (screen == null)
                throw new ArgumentNullException("screen");

            this.screen = screen;
            this.rootWindow = window;
        }
        public MotionTrackingDevice(Window window, MotionTrackingScreen screen)
            : base()
        {
            if (window == null)
                throw new ArgumentNullException("window");
            if (screen == null)
                throw new ArgumentNullException("screen");

            this.screen = screen;
            this.rootWindow = window;
            _activeSource = PresentationSource.FromVisual(window);

            Activate();
        }
        public MotionTrackingClient(FrameworkElement root, MotionTrackingScreen screen = null)
        {
            RegisterWindow(root);

            if (Window.IsLoaded)
            {
                RegisterScreen(screen);
            }
            else
            {
                Window.Loaded += (s, e) =>
                    {
                        RegisterScreen(screen);
                    };
            }

            ProcessDepthImage = true;

            this.imageProcessor = ImageProcessor.Instance;
            this.DepthVisualization = imageProcessor.DepthPresenter.ImageSource;

            MotionTracking.RegisterEvents(this);
        }
        private void RegisterScreen(MotionTrackingScreen screen)
        {
            if (screen == null)
            {
                screen = new MotionTrackingScreen()
                {
                    ScreenWidth = Window.ActualWidth,
                    ScreenHeight = Window.ActualHeight
                };
            }

            this.Screen = screen;
            imageProcessor.AddScreen(this.Screen);

            this.HandVisualization = imageProcessor.GetImageSourceForScreen(this.Screen);
        }