CCT.NUI.WPFSamples.MainWindow.Start C# (CSharp) Method

Start() private method

private Start ( ) : void
return void
        private void Start()
        {
            this.Cursor = Cursors.Wait;
            this.buttonHandInterface.IsEnabled = true;
            this.buttonManipulation.IsEnabled = true;
            this.buttonRectangleVideo.IsEnabled = true;
            this.buttonTouch.IsEnabled = true;
            this.checkClusterLayer.IsEnabled = true;
            this.checkHandLayer.IsEnabled = true;
            this.radioKinectSDK.IsEnabled = false;
            this.radioOpenNI.IsEnabled = false;

            if (this.radioKinectSDK.IsChecked.GetValueOrDefault())
            {
                this.factory = new SDKDataSourceFactory();
            }
            else
            {
                this.factory = new OpenNIDataSourceFactory("config.xml");
            }
            this.clusterDataSource = this.factory.CreateClusterDataSource(new Core.Clustering.ClusterDataSourceSettings { MaximumDepthThreshold = 900 });
            this.handDataSource = new HandDataSource(this.factory.CreateShapeDataSource(this.clusterDataSource, new Core.Shape.ShapeDataSourceSettings()));
            this.rgbImageDataSource = this.factory.CreateRGBImageDataSource();
            this.rgbImageDataSource.Start();

            var depthImageSource = this.factory.CreateDepthImageDataSource();
            depthImageSource.NewDataAvailable += new NewDataHandler<ImageSource>(MainWindow_NewDataAvailable);
            depthImageSource.Start();
            handDataSource.Start();
            this.Cursor = Cursors.Arrow;
        }