title: KinectColorViewer SDK 1.7
body: <p>I'm trying to make KinectColorViewer to work with SDK 1.7 but without success. I can display video picture only if I manually copy pixels from camera to Image element.</p>
  
  <p>I have the following XAML:</p>
  
  <pre><code>&lt;Page
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:k="http://schemas.microsoft.com/kinect/2013"
    xmlns:WpfViewers="clr-namespace:Microsoft.Samples.Kinect.WpfViewers;assembly=Microsoft.Samples.Kinect.WpfViewers" x:Class="KinectD.Camera"
    mc:Ignorable="d" 
    d:DesignHeight="300" d:DesignWidth="500"
  Title="Camera"&gt;
  
  &lt;Grid&gt;
      &lt;k:KinectUserViewer k:KinectRegion.KinectRegion="{Binding ElementName=kinectRegion}" Height="100" HorizontalAlignment="Center" VerticalAlignment="Top" /&gt;
      &lt;k:KinectSensorChooserUI HorizontalAlignment="Center" VerticalAlignment="Top" x:Name="sensorChooserUi" /&gt;
  
      &lt;k:KinectRegion x:Name="kinectRegion"&gt;
          &lt;Grid&gt;
              &lt;k:KinectCircleButton Label="Menu" HorizontalAlignment="Right" Height="200" VerticalAlignment="Top" Click="MenuButtonOnClick" &gt;
                  &lt;StackPanel&gt;
                      &lt;Image Source="Images/smile.png" Height="30"/&gt;
                  &lt;/StackPanel&gt;
              &lt;/k:KinectCircleButton&gt;
  
          &lt;/Grid&gt;
      &lt;/k:KinectRegion&gt;
      &lt;WpfViewers:KinectColorViewer HorizontalAlignment="Left" Height="240" Margin="10,10,0,0" VerticalAlignment="Top" Width="320" Kinect="{Binding ElementName=sensorChooserUi, Mode=OneWay, Path=Kinect}"/&gt;
  
  
  &lt;/Grid&gt;
  </code></pre>
  
  <p></p>
  
  <p>And XAML.CS:</p>
  
  <pre><code>public partial class Camera : Page
  {
      #region "Kinect"
      private KinectSensorChooser sensorChooser;
      #endregion
  
      public Camera()
      {
  
          this.InitializeComponent();
          // initialize the sensor chooser and UI
          this.sensorChooser = new KinectSensorChooser();
          //Assign the sensor chooser with the sensor chooser from the mainwindow. 
          //We are reusing the sensorchoosing declared in the first window that can in contact with kinect
          this.sensorChooser = Generics.GlobalKinectSensorChooser;
          //subscribe to the sensorChooserOnKinectChanged event
          this.sensorChooser.KinectChanged += SensorChooserOnKinectChanged;
          //Assign Kinect Sensorchooser to the sensorchooser we got from our static class
          this.sensorChooserUi.KinectSensorChooser = sensorChooser;
          // Bind the sensor chooser's current sensor to the KinectRegion
          var regionSensorBinding = new Binding("Kinect") { Source = this.sensorChooser };
          BindingOperations.SetBinding(this.kinectRegion, KinectRegion.KinectSensorProperty, regionSensorBinding);
      }
  
      private void SensorChooserOnKinectChanged(object sender, KinectChangedEventArgs args)
      {
          bool error = false;
          if (args.OldSensor != null)
          {
              try
              {
                  args.OldSensor.DepthStream.Range = DepthRange.Default;
                  args.OldSensor.SkeletonStream.EnableTrackingInNearRange = false;
                  args.OldSensor.DepthStream.Disable();
                  args.OldSensor.SkeletonStream.Disable();
  
                  args.OldSensor.ColorStream.Disable();
              }
              catch (InvalidOperationException)
              {
                  // KinectSensor might enter an invalid state while enabling/disabling streams or stream features.
                  // E.g.: sensor might be abruptly unplugged.
                  error = true;
              }
          }
  
          if (args.NewSensor != null)
          {
              try
              {
                  args.NewSensor.DepthStream.Enable(DepthImageFormat.Resolution640x480Fps30);
                  args.NewSensor.ColorStream.Enable(ColorImageFormat.RgbResolution640x480Fps30);
                  args.NewSensor.SkeletonStream.Enable();
              }
              catch (InvalidOperationException)
              {
                  error = true;
                  // KinectSensor might enter an invalid state while enabling/disabling streams or stream features.
                  // E.g.: sensor might be abruptly unplugged.
              }
          }
  
          if (!error)
              kinectRegion.KinectSensor = args.NewSensor;
      }
  
      private void MenuButtonOnClick(object sender, RoutedEventArgs e)
      {
          //Unsubscribe to the sensorchooser's  event SensorChooseronkinectChanged
          this.sensorChooser.KinectChanged -= SensorChooserOnKinectChanged;
          (Application.Current.MainWindow.FindName("_mainFrame") as Frame).Source = new Uri("MainMenu.xaml", UriKind.Relative);
      }
  }
  </code></pre>
  
  <p>In tutorial I was following (<a href="http://channel9.msdn.com/Series/KinectQuickstart/Camera-Fundamentals" rel="nofollow">http://channel9.msdn.com/Series/KinectQuickstart/Camera-Fundamentals</a>) instructor just drops KinectColorViewer to a screen, sets path and it's working.</p>