public BubblesGameConfigPage(string itemId, KinectSensorChooser kinectSensor) { InitializeComponent(); _kinectSensor = kinectSensor; Config = new BubblesGameConfig(); DataContext = Config; }
public MainWindow(BubblesGameConfig config) { KinectSensorManager = new KinectSensorManager(); KinectSensorManager.KinectSensorChanged += KinectSensorChanged; DataContext = KinectSensorManager; InitializeComponent(); SensorChooserUI.KinectSensorChooser = sensorChooser; sensorChooser.Start(); // Bind the KinectSensor from the sensorChooser to the KinectSensor on the KinectSensorManager var kinectSensorBinding = new Binding("Kinect") { Source = sensorChooser }; BindingOperations.SetBinding(KinectSensorManager, KinectSensorManager.KinectSensorProperty, kinectSensorBinding); RestoreWindowState(); }
public MainWindow(BubblesGameConfig config) { InitializeComponent(); this.config = config; this._sensorChooser = new KinectSensorChooser(); this._sensorChooser.KinectChanged += _sensorChooser_KinectChanged; this.sensorChooserUi.KinectSensorChooser = this._sensorChooser; this.config.PassedKinectSensorChooser = this._sensorChooser; this._sensorChooser.Start(); }
public GameWindow(BubblesGameConfig config) { InitializeComponent(); this.config = config; SetupKinectSensor(config); startTime = DateTime.Now; RestoreWindowState(); }
private void SetupKinectSensor(BubblesGameConfig config = null) { KinectSensorManager = new KinectSensorManager(); KinectSensorManager.KinectSensorChanged += KinectSensorChanged; DataContext = KinectSensorManager; if (config == null) { SensorChooserUI.KinectSensorChooser = _sensorChooser; _sensorChooser.Start(); var kinectSensorBinding = new Binding("Kinect") { Source = _sensorChooser }; BindingOperations.SetBinding(KinectSensorManager, KinectSensorManager.KinectSensorProperty, kinectSensorBinding); } else { SensorChooserUI.KinectSensorChooser = config.PassedKinectSensorChooser; _sensorChooser.Start(); var kinectSensorBinding = new Binding("Kinect") { Source = config.PassedKinectSensorChooser }; BindingOperations.SetBinding(KinectSensorManager, KinectSensorManager.KinectSensorProperty, kinectSensorBinding); } }