public MainWindow(KinectController controller) { InitializeComponent(); Loaded += OnLoaded; //_instagramAPI = new InstagramAPIManager(); //_instagramAPI.saveRecentImages(); _navigator = new Navigator(this); _pageFactory = new KinectPageFactory(_navigator); _navigator.SetMainMenu(_pageFactory.GetMainMenu()); _navigator.SetSleepScreen(_pageFactory.GetSleepScreen()); _kinectController = controller; _kinectController.EngagedUserColor = (Color)this.Resources["EngagedUserColor"]; _kinectController.TrackedUserColor = (Color)this.Resources["TrackedUserColor"]; _kinectController.EngagedUserMessageBrush = (Brush)this.Resources["EngagedUserMessageBrush"]; _kinectController.TrackedUserMessageBrush = (Brush)this.Resources["TrackedUserMessageBrush"]; _kinectController.Navigator = _navigator; kinectRegion.HandPointersUpdated += (sender, args) => _kinectController.OnHandPointersUpdated(this.kinectRegion.HandPointers); DataContext = _kinectController; _movementDetector = new MouseMovementDetector(this); _movementDetector.IsMovingChanged += OnIsMouseMovingChanged; _movementDetector.Start(); }
public MainWindow(KinectController kinectController) { InitializeComponent(); if (kinectController == null) { throw new ArgumentNullException("controller", Properties.Resources.KinectControllerInvalid); } this.kinectController = kinectController; kinectController.EngagedUserColor = (Color)this.Resources["EngagedUserColor"]; kinectController.TrackedUserColor = (Color)this.Resources["TrackedUserColor"]; kinectController.EngagedUserMessageBrush = (Brush)this.Resources["EngagedUserMessageBrush"]; kinectController.TrackedUserMessageBrush = (Brush)this.Resources["TrackedUserMessageBrush"]; this.kinectRegion.HandPointersUpdated += (sender, args) => kinectController.OnHandPointersUpdated(this.kinectRegion.HandPointers); this.DataContext = kinectController; this.mouseMovementDetector = new MouseMovementDetector(this); this.mouseMovementDetector.IsMovingChanged += this.OnIsMouseMovingChanged; this.mouseMovementDetector.Start(); }