I have never added a KinectSensorChooserUI control to a toolbar in Visual Studio. The need for this does not really exist.
If you think this is mandatory, I found the message Adding your WPF control to a toolbar , which may be useful. I havenβt tried it myself, so I canβt promise that it will work.
I personally do not use the KinectSensorChooser user interface KinectSensorChooser . Unless you really plan on turning Kinect on / off or switching between multiple Kinect manually, this is not really a big deal. This gives some feedback, but it can be done in other more aesthetically pleasing ways.
To use KinectSensorChooser you just need the following in your main class:
private readonly KinectSensorChooser _sensorChooser = new KinectSensorChooser(); public MainViewModel() {
You now have an active KinectSensorChooser , minus the user interface.
If you want to use the user interface component, do not try to add it to the toolbar and simply follow these steps:
- Add Toolkit project or link to .dll.
- Add a namespace to your Xaml so you can reference the controls in your markup.
xmlns:kt="clr-namespace:Microsoft.Kinect.Toolkit;assembly=Microsoft.Kinect.Toolkit" - Add a control to your visual tree
<kt:KinectSensorChooserUI x:Name="SensorChooserUI" />
Your code will declare a namespace, initialize KinectSensorChooser and configure any events you want.
using Microsoft.Kinect; using Microsoft.Kinect.Toolkit; private readonly KinectSensorChooser _sensorChooser = new KinectSensorChooser();
source share