using CommunityToolkit.Mvvm.Input; using KinectConnection; using System.Windows.Input; namespace KinectSensorStreams.ViewModel { public class MainWindowVM { #region Properties /// /// Propriété liée à la commande appelée au démarrage de la page principale /// public ICommand StartCommand { get; set; } /// /// Propriété liée à l'objet KinectManager /// public KinectManager KinectManager { get; set; } #endregion #region Constructor /// /// Constructeur du ViewModel de la page principale /// public MainWindowVM() { KinectManager = new KinectManager(); StartCommand = new RelayCommand(Start); // [Question] : StartCommand ici peut être mieux que BeginInit() dans MainWindow.xaml.cs ? } #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() { KinectManager.StartSensor(); } #endregion } }