コード例 #1
0
 public BubblesGameConfigPage(string itemId, KinectSensorChooser kinectSensor)
 {
     InitializeComponent();
     _kinectSensor = kinectSensor;
     Config = new BubblesGameConfig();
     DataContext = Config;
 }
コード例 #2
0
        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();
        }
コード例 #3
0
 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();
 }
コード例 #4
0
 public GameWindow(BubblesGameConfig config)
 {
     InitializeComponent();
     this.config = config;
     SetupKinectSensor(config);
     startTime = DateTime.Now;
     RestoreWindowState();
 }
コード例 #5
0
        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);
            }
        }