This project is read-only.

Crash After jump in a new WPF using user control

Jan 17, 2013 at 4:57 PM
Edited Jan 17, 2013 at 5:00 PM

Hi guys, i'm tring to make an application that run in a single window using kinect.

I'm merging http://azerdark.wordpress.com/2010/04/23/multi-page-application-in-wpf/ project with the KinectUI.

After all the project start and run well if I use the mouse, but using the Kinect I have a crash every time I'm going to open a new page.

I have 3 buttons with magnetic sets on true, the application crash after the progress bar loading.

What could be the problem?

Thanks at all who will answer.

Visual Studio bring me here:

 

                foreach (FrameworkElement element in MagneticsControl)
                {
                    // Getting the four corners
                    var position = element.TransformToAncestor(rootVisual).Transform(new Point(0, 0));
                    var p1 = new Vector2((float)position.X, (float)position.Y);
                    var p2 = new Vector2((float)(position.X + element.ActualWidth), (float)position.Y);
                    var p3 = new Vector2((float)(position.X + element.ActualWidth), (float)(position.Y + element.ActualHeight));
                    var p4 = new Vector2((float)position.X, (float)(position.Y + element.ActualHeight));
Jan 18, 2013 at 7:53 AM

Could you share the exception raised? 

Jan 18, 2013 at 1:15 PM

Hi Deltakosh, thanks for you reply.

The program crash after open the new usercontrol page and the PresenceControll load again the skeleton.

This is the exception

System.InvalidOperationException occurred  HResult=-2146233079  Message=(Current Visual is not main parent of this Visual) Il Visual specificato non è un predecessore di questo Visual.  Source=PresentationCore  StackTrace:       in System.Windows.Media.Visual.TrySimpleTransformToAncestor(Visual ancestor, Boolean inverse, GeneralTransform& generalTransform, Matrix& simpleTransform)       in System.Windows.Media.Visual.TransformToAncestor(Visual ancestor)       in Kinect.Toolbox.MouseController.SetHandPosition(KinectSensor sensor, Joint joint, Skeleton skeleton) in c:\Users\Alessandro\Documents\Visual Studio 2012\Projects\Kinect Toolbox\Sources\Mouse\MouseController.cs:riga 281  InnerException: