/// <summary> /// Handle a button click from the wrap panel. /// </summary> /// <param name="sender">Event sender</param> /// <param name="e">Event arguments</param> private void KinectTileButtonClick(object sender, RoutedEventArgs e) { var button = (KinectTileButton)e.OriginalSource; var selectionDisplay = new SelectionDisplay(button.Label as string); this.kinectRegionGrid.Children.Add(selectionDisplay); e.Handled = true; this.IsEnabled = false; string buttonLabel = (string)button.Label; int postureIndex = 0; if (buttonLabel == "1") { postureIndex = 1; } else if (buttonLabel == "2") { postureIndex = 2; } if (postureIndex < 0) { return; } temp = new KinectExplorer.MainWindow(postureIndex); temp.OnChildReturnEventInMainWindow += new KinectExplorer.MainWindow.OnChildClosedForReturnValueInMainWindow(OnChildReturnEvent); temp.Closed += WindowClosedForMachineCheck; temp.Show(); }
public void cw_OnChildCallBack(int ret) { returnValueFromKinectSensorWindow = ret; Console.WriteLine(returnValueFromKinectSensorWindow + " ControlBasics.MainWindow"); //1 true, 2 false if (returnValueFromKinectSensorWindow == 1) //성공이면 다음버튼을 눌러야함. { Console.WriteLine(returnValueFromKinectSensorWindow + " asdasd"); returnValueFromKinectSensorWindow = 0; postureIndex++; temp = new KinectExplorer.MainWindow(postureIndex);//인덱스 넘기기 temp.Closed += WindowClosedForMachineCheck; temp.OnChildReturnValueEventInMainWindow += new KinectExplorer.MainWindow.OnChildReturnValueHandlerInMainWindow(cw_OnChildCallBack); this.IsEnabled = false; temp.Show(); } }