Kinect initialization RRS feed

  • Question

  • A couple of weeks ago, an article that included some tips for development was published in Kinect for Windows Blog.

    One of those tips was:

    - "Initialize the Kinect sensor object and all readers in the Form Loaded event handler of a WPF window, not the constructor".

    However, I would say that in SDK demos these tasks are usually performed in the MainWindow constructor and in some of them they're shared between constructor and window loaded handler.

    Is there any real difference? Why an approach should be preferred to another?

    Monday, April 13, 2015 12:04 PM

All replies

  • I'll weigh in on this topic...

    I would say this all depends on your usage of the Kinect enabled application. The going assumption is that if you're building a WPF application, you may opt to use the Kinect Interaction Controls. If this is the case, these controls and similar UI based controls are focused more on the Event model. The best approach and recommended action when working with this model is to start using the Kinect device during a point in time where the WPF window and handles are valid for pumping these event for consumption of the user controls. This is typically during the Form Loaded event.

    On the other hand if you're building a WPF application, and you're not using the event model per se, but some other non-related UI feature such as a container for another Drawing engine let's say DirectX, you're using the gamer's loop. This pattern is more focused on polling for states which usually means the Kinect object or readers need to be available prior to the loop.

    Sr. Enterprise Architect | Trainer | Consultant | MCT | MCSD | MCPD | SharePoint TS | MS Virtual TS |Windows 8 App Store Developer | Linux Gentoo Geek | Raspberry Pi Owner | Micro .Net Developer | Kinect For Windows Device Developer |blog:

    Tuesday, April 14, 2015 10:45 PM