I would like to display color frame from Kinect for Windows v2 on the WPF window. I want to use MVVM light toolkit.
In tradition way (code behind) I should use:
private void InitializeCamera()
{
if (_kinect == null) return;
FrameDescription desc = _kinect.ColorFrameSource.FrameDescription;
_colorReader = _kinect.ColorFrameSource.OpenReader();
_colorPixels = new byte[desc.Width * desc.Height * _bytePerPixel];
_colorBitmap = new WriteableBitmap(desc.Width, desc.Height, 96, 96, PixelFormats.Bgr32, null);
CameraImage.Source = _colorBitmap;
_colorReader.FrameArrived += OnColorFrameArrived;
}
In XAML I have:
<Image x:Name="CameraImage" />
So how can I bind data from ViewModel to my view ?