using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.Input; using KinectConnection; using KinectConnection.enums; using KinectUtils; using System.Linq; using System.Net.NetworkInformation; using System.Windows.Input; namespace KinectSensorStreams.ViewModel { public class MainWindowVM : ObservableObject { private BodyImageStream bodyImageStream; #region Properties /// /// Propriété liée à la commande appelée au démarrage de la page principale /// public ICommand StartCommand { get; set; } public ICommand BodyCommand { get; set; } /// /// The Kinect stream property. /// public BodyImageStream BodyImageStream { get { return bodyImageStream; } set { SetProperty(ref bodyImageStream, value); } } #endregion #region Constructor /// /// Constructeur du ViewModel de la page principale /// public MainWindowVM() { StartCommand = new RelayCommand(Start); BodyCommand = new RelayCommand(Body); } #endregion #region Methods /// /// Méthode initialisée au lancement de la page principale pour savoir si le Kinect est disponible ou non /// private void Start() { GestureManager.KinectManager.StartSensor(); } private void Body() { if (BodyImageStream != null) { BodyImageStream.Stop(); } BodyImageStream = new BodyImageStream(); BodyImageStream.Start(); //GestureManager.GestureRecognized += GestureManager.KnownGestures.FirstOrDefault().TestGesture(); } #endregion } }