private static void KinectDeviceChanged(DependencyObject owner, DependencyPropertyChangedEventArgs e) { WatchSkeleton viewer = (WatchSkeleton)owner; if (e.OldValue != null) { ((KinectSensor)e.OldValue).SkeletonFrameReady -= viewer.KinectDevice_SkeletonFrameReady; viewer._FrameSkeletons = null; } if (e.NewValue != null) { viewer.KinectDevice = (KinectSensor)e.NewValue; viewer.KinectDevice.SkeletonFrameReady += viewer.KinectDevice_SkeletonFrameReady; viewer._FrameSkeletons = new Skeleton[viewer.KinectDevice.SkeletonStream.FrameSkeletonArrayLength]; } }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.LayoutRoot = ((System.Windows.Controls.Grid)(target)); return; case 2: this.SkeletonViewer = ((CalculateSpaceCoordinate.WatchSkeleton)(target)); return; case 3: this.number_z = ((System.Windows.Controls.TextBlock)(target)); return; case 4: this.BeginPointText = ((System.Windows.Controls.TextBlock)(target)); return; case 5: this.EndPointText = ((System.Windows.Controls.TextBlock)(target)); return; case 6: this.BegintoEndAngleText = ((System.Windows.Controls.TextBlock)(target)); return; case 7: this.BeginZText = ((System.Windows.Controls.TextBlock)(target)); return; case 8: this.EndZText = ((System.Windows.Controls.TextBlock)(target)); return; case 9: this.LengthText = ((System.Windows.Controls.TextBlock)(target)); return; } this._contentLoaded = true; }