/// <summary> /// Initializes a new instance of the <see cref="DesktopMainWindow"/> class. /// </summary> public DesktopMainWindow() { this.InitializeComponent(); // initialize the sensor chooser and UI this.sensorChooser = new KinectSensorChooser(); this.sensorChooser.KinectChanged += SensorChooserOnKinectChanged; this.sensorChooserUi.KinectSensorChooser = this.sensorChooser; this.sensorChooser.Start(); // Bind listner to scrollviwer scroll position change, and check scroll viewer position this.UpdatePagingButtonState(); scrollViewer.ScrollChanged += (o, e) => this.UpdatePagingButtonState(); this.WindowState = System.Windows.WindowState.Maximized; speechControl = new KinectSpeechControl(this.sensorChooser.Kinect); repository = new SkeletonStateRepository(); this.kinectRegion.Repository = repository; grammar = speechControl.CreateGrammarFromResource(Properties.Resources.WindowGrammar); StartEvents(); }