none
KinectRegion not found in XML namespace RRS feed

  • Question

  • I'm using Microsoft Visual Studio Express 2013 For Desktop to develop a Kinect App with SDK v2

    I have the Kinect v2 for Windows.

    But I can't compile my simple software, I tried several times but I could get it working.

    XML

    <Window x:Class="WpfApplication1.MainWindow"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            xmlns:k="http://schemas.microsoft.com/kinect/2013"
            Title="MainWindow" Height="350" Width="525">
      <Grid Background="Azure">
        <Grid.RowDefinitions>
          <RowDefinition Height="2*" />
          <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="2*" />
          <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <k:KinectRegion x:Name="kinectRegion">
          <Canvas Background="Red"
                  PointerPressed="OnDown"
                  PointerReleased="OnUp"
                  PointerMoved="OnMoved"
                  x:Name="myCanvas" />
        </k:KinectRegion>
      </Grid>
    </Window>
    

    C# code

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; namespace WpfApplication1 { using Microsoft.Kinect; using Microsoft.Kinect.Input; using Microsoft.Kinect.Toolkit; using Microsoft.Kinect.Wpf.Controls; /// <summary> /// Lógica de interacción para MainWindow.xaml /// </summary> public partial class MainWindow : Window { private KinectSensor sensor; public MainWindow() { this.InitializeComponent(); sensor = KinectSensor.GetDefault(); sensor.IsAvailableChanged += SensorStopped; sensor.Open(); Closing += OnWindowClosing; } public void OnWindowClosing(object sender, System.ComponentModel.CancelEventArgs e) { sensor.Close(); } void SensorStopped(object sender, IsAvailableChangedEventArgs args){ if (!args.IsAvailable) { MessageBox.Show("Sensor apagado!"); } else { MessageBox.Show("Sensor encendido!"); } } } }

    Error: Error    1    tag 'KinectRegion' doesn't exist in XML namespace 'http://schemas.microsoft.com/kinect/2013'.

    Sunday, October 19, 2014 3:43 PM

Answers

  • Hello,  try using this namespace:

    xmlns:k="http://schemas.microsoft.com/kinect/2014"

    2014 instead of 2013.

    Monday, October 20, 2014 3:10 PM