private void KinectSkeletonViewer_OnLoaded(object sender, RoutedEventArgs e) { // Build a set of Skeletons, and bind each of their control properties to those // exposed on this class so that changes are propagated. for (int i = 0; i < SkeletonCount; i++) { var skeletonCanvas = new KinectSkeleton(); skeletonCanvas.ClipToBounds = true; var showBonesBinding = new Binding("ShowBones"); showBonesBinding.Source = this; skeletonCanvas.SetBinding(KinectSkeleton.ShowBonesProperty, showBonesBinding); var showJointsBinding = new Binding("ShowJoints"); showJointsBinding.Source = this; skeletonCanvas.SetBinding(KinectSkeleton.ShowJointsProperty, showJointsBinding); var showCenterBinding = new Binding("ShowCenter"); showCenterBinding.Source = this; skeletonCanvas.SetBinding(KinectSkeleton.ShowCenterProperty, showCenterBinding); this.skeletonCanvases.Add(skeletonCanvas); this.jointMappings.Add(new Dictionary <JointType, JointMapping>()); this.SkeletonCanvasPanel.Children.Add(skeletonCanvas); } }
private void KinectSkeletonViewer_OnLoaded(object sender, RoutedEventArgs e) { // Build a set of Skeletons, and bind each of their control properties to those // exposed on this class so that changes are propagated. for (int i = 0; i < SkeletonCount; i++) { var skeletonCanvas = new KinectSkeleton(); skeletonCanvas.ClipToBounds = true; var showBonesBinding = new Binding("ShowBones"); showBonesBinding.Source = this; skeletonCanvas.SetBinding(KinectSkeleton.ShowBonesProperty, showBonesBinding); var showJointsBinding = new Binding("ShowJoints"); showJointsBinding.Source = this; skeletonCanvas.SetBinding(KinectSkeleton.ShowJointsProperty, showJointsBinding); var showCenterBinding = new Binding("ShowCenter"); showCenterBinding.Source = this; skeletonCanvas.SetBinding(KinectSkeleton.ShowCenterProperty, showCenterBinding); this.skeletonCanvases.Add(skeletonCanvas); this.jointMappings.Add(new Dictionary<JointType, JointMapping>()); this.SkeletonCanvasPanel.Children.Add(skeletonCanvas); } }