/// <summary> /// Initializes a new instance of the MainViewModel class. /// </summary> public MainViewModel(IKioskInteractionService interactionService, ISpeechService speechService, IItemInteractionService manipulationService, IConfigurationProvider configurationProvider) { this.RowWidth = DEPTH_WIDTH; _kioskInteractionService = interactionService; _kioskInteractionService.KioskStateChanged += _kioskInteractionService_KioskStateChanged; _kioskInteractionService.BodyTrackUpdate += _kioskInteractionService_BodyTrackUpdate; BodyTrack = new ObservableCollection <double>() { -75, -75, -75, -75, -75, -75 }; _itemInteractionService = manipulationService; _itemInteractionService.ServiceStateChanged += _itemInteractionService_ServiceStateChanged; _itemInteractionService.ItemInteraction += _itemInteractionService_ItemInteraction; _itemInteractionService.PropertyChanged += _itemInteractionService_PropertyChanged; _speechService = speechService; _speechService.SpeechRecognized += _speechService_SpeechRecognized; _speechService.SpeechRejected += _speechService_SpeechRejected; _speechService.StartListening(); _speechService.Speak("Kiosk Ready"); Messenger.Default.Register <string>(this, (msg) => { if (msg == "SPECIALSTOP") { Debug.WriteLine("MVM SPECIALSTOP " + _lastKioskState); this.KioskState = "CloseSpecial"; } }); this.OpenObjectDetection = new RelayCommand(() => { ShowObjectDetectionWindow(true); }); _configurationProvider = configurationProvider; _configurationProvider.ConfigurationSettingsChanged += _configurationProvider_ConfigurationSettingsChanged; GetConfig(); // Show Object Detection Window on start up ShowObjectDetectionWindow(); }
/// <summary> /// Initializes a new instance of the MainViewModel class. /// </summary> public MainViewModel(IKioskInteractionService interactionService, ISpeechService speechService, IItemInteractionService manipulationService, IConfigurationProvider configurationProvider) { this.RowWidth = DEPTH_WIDTH; _kioskInteractionService = interactionService; _kioskInteractionService.KioskStateChanged += _kioskInteractionService_KioskStateChanged; _kioskInteractionService.BodyTrackUpdate += _kioskInteractionService_BodyTrackUpdate; BodyTrack = new ObservableCollection<double>() { -75, -75, -75, -75, -75, -75 }; _itemInteractionService = manipulationService; _itemInteractionService.ServiceStateChanged += _itemInteractionService_ServiceStateChanged; _itemInteractionService.ItemInteraction += _itemInteractionService_ItemInteraction; _itemInteractionService.PropertyChanged += _itemInteractionService_PropertyChanged; _speechService = speechService; _speechService.SpeechRecognized += _speechService_SpeechRecognized; _speechService.SpeechRejected += _speechService_SpeechRejected; _speechService.StartListening(); _speechService.Speak("Kiosk Ready"); Messenger.Default.Register<string>(this, (msg) => { if (msg == "SPECIALSTOP") { Debug.WriteLine("MVM SPECIALSTOP " + _lastKioskState); this.KioskState = "CloseSpecial"; } }); this.OpenObjectDetection = new RelayCommand(() => { ShowObjectDetectionWindow(true); }); _configurationProvider = configurationProvider; _configurationProvider.ConfigurationSettingsChanged += _configurationProvider_ConfigurationSettingsChanged; GetConfig(); // Show Object Detection Window on start up ShowObjectDetectionWindow(); }