Esempio n. 1
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.ColorImage = ((System.Windows.Controls.Image)(target));
                return;

            case 2:
                this.FaceTrackingViewer = ((WpfApplication1_FaceTracking1.FaceTrackingViewer)(target));
                return;
            }
            this._contentLoaded = true;
        }
        public MainWindow()
        {
            InitializeComponent();

            var faceTrackingViewerBinding = new Binding("Kinect")
            {
                Source = sensorChooser
            };

            FaceTrackingViewer.SetBinding(FaceTrackingViewer.KinectProperty, faceTrackingViewerBinding);

            sensorChooser.KinectChanged += SensorChooserOnKinectChanged;

            sensorChooser.Start();
        }
 private void WindowClosed(object sender, EventArgs e)
 {
     sensorChooser.Stop();
     FaceTrackingViewer.Dispose();
 }