using Microsoft.Kinect; using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Media; using System.Windows.Media.Imaging; namespace Lib { public abstract class KinectStream : INotifyPropertyChanged { public KinectManager KinectManager { get; private set; } private WriteableBitmap bitmap; public WriteableBitmap Bitmap { get { return bitmap; } protected set { if (bitmap != value) { bitmap = value; OnPropertyChanged(nameof(bitmap)); } } } public event PropertyChangedEventHandler PropertyChanged; public void OnPropertyChanged(string propertyName) { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); } public KinectStream() { KinectManager = new KinectManager(); } public virtual void Start() { KinectManager.StartSensor(); } public virtual void Stop() { KinectManager.StopSensor(); } } }