コード例 #1
0
        public FaceWindow(List <Game> _games, double difficulty, MainWindow _mainWindow)
        {
            mainWindow = _mainWindow;
            InitializeComponent();
            currentGameIndex = 0;
            games = _games;

            gameEndedWindow = new GameEnded();

            var faceTrackingViewerBinding = new Binding("Kinect") { Source = sensorChooser };
            faceTrackingViewer.SetBinding(FaceTrackingViewer.KinectProperty, faceTrackingViewerBinding);

            sensorChooser.KinectChanged += SensorChooserOnKinectChanged;

            TaskProgressBar.Maximum = (int)games[0].getTargetScore() ;
            setWaitText();

            faceTrackingViewer.setMainWindow(this);
            faceTrackingViewer.setGame(games[0]);

            sensorChooser.Start();
        }
コード例 #2
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.form1 = ((FaceTrackingBasics.MainWindow)(target));

            #line 7 "..\..\..\MainWindow.xaml"
                this.form1.Closed += new System.EventHandler(this.WindowClosed);

            #line default
            #line hidden

            #line 8 "..\..\..\MainWindow.xaml"
                this.form1.Loaded += new System.Windows.RoutedEventHandler(this.form1_Loaded);

            #line default
            #line hidden

            #line 8 "..\..\..\MainWindow.xaml"
                this.form1.Closing += new System.ComponentModel.CancelEventHandler(this.form1_Closing);

            #line default
            #line hidden
                return;

            case 2:
                this.layoutGrid = ((System.Windows.Controls.Grid)(target));
                return;

            case 3:
                this.viewBox1 = ((System.Windows.Controls.Viewbox)(target));
                return;

            case 4:
                this.MainGrid = ((System.Windows.Controls.Grid)(target));
                return;

            case 5:
                this.ColorImage = ((System.Windows.Controls.Image)(target));
                return;

            case 6:
                this.faceTrackingViewer = ((FaceTrackingBasics.FaceTrackingViewer)(target));
                return;

            case 7:
                this.image1 = ((System.Windows.Controls.Image)(target));

            #line 40 "..\..\..\MainWindow.xaml"
                this.image1.MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.image1_MouseDown);

            #line default
            #line hidden

            #line 40 "..\..\..\MainWindow.xaml"
                this.image1.MouseEnter += new System.Windows.Input.MouseEventHandler(this.image1_MouseEnter);

            #line default
            #line hidden

            #line 40 "..\..\..\MainWindow.xaml"
                this.image1.MouseLeave += new System.Windows.Input.MouseEventHandler(this.image1_MouseLeave);

            #line default
            #line hidden
                return;

            case 8:
                this.image2 = ((System.Windows.Controls.Image)(target));

            #line 41 "..\..\..\MainWindow.xaml"
                this.image2.MouseEnter += new System.Windows.Input.MouseEventHandler(this.image2_MouseEnter);

            #line default
            #line hidden

            #line 41 "..\..\..\MainWindow.xaml"
                this.image2.MouseLeave += new System.Windows.Input.MouseEventHandler(this.image2_MouseLeave);

            #line default
            #line hidden

            #line 41 "..\..\..\MainWindow.xaml"
                this.image2.MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.image2_MouseDown);

            #line default
            #line hidden
                return;

            case 9:
                this.image3 = ((System.Windows.Controls.Image)(target));

            #line 42 "..\..\..\MainWindow.xaml"
                this.image3.MouseEnter += new System.Windows.Input.MouseEventHandler(this.image3_MouseEnter);

            #line default
            #line hidden

            #line 42 "..\..\..\MainWindow.xaml"
                this.image3.MouseLeave += new System.Windows.Input.MouseEventHandler(this.image3_MouseLeave);

            #line default
            #line hidden

            #line 42 "..\..\..\MainWindow.xaml"
                this.image3.MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.image3_MouseDown);

            #line default
            #line hidden
                return;

            case 10:
                this.image4 = ((System.Windows.Controls.Image)(target));

            #line 43 "..\..\..\MainWindow.xaml"
                this.image4.MouseEnter += new System.Windows.Input.MouseEventHandler(this.image4_MouseEnter);

            #line default
            #line hidden

            #line 43 "..\..\..\MainWindow.xaml"
                this.image4.MouseLeave += new System.Windows.Input.MouseEventHandler(this.image4_MouseLeave);

            #line default
            #line hidden

            #line 43 "..\..\..\MainWindow.xaml"
                this.image4.MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.image4_MouseDown);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }