/// <summary> /// This method is called when the app first appears, but it also checks if it has been launched /// using Cortana's voice commands, and takes appropriate action if this is the case. /// </summary> protected async override void OnNavigatedTo(NavigationEventArgs e) { _dispatcher = CoreWindow.GetForCurrentThread().Dispatcher; _presence = new UserPresence(_dispatcher, _unfilteredName); _pageParameters = e.Parameter as VoiceCommandObjects.VoiceCommand; if (_pageParameters != null) { switch(_pageParameters.VoiceCommandName) { case "addNewNote": _activeNote = CreateNote(App.EVERYONE); break; case "addNewNoteForPerson": _activeNote = CreateNote(_pageParameters.NoteOwner); break; default: break; } } //Perform initialization for facial detection. if (AppSettings.FaceApiKey != "") { await FacialSimilarity.TrainDetectionAsync(); } // Perform initialization for speech recognition. _speechManager = new SpeechManager(FamilyModel); _speechManager.PhraseRecognized += speechManager_PhraseRecognized; _speechManager.StateChanged += speechManager_StateChanged; await _speechManager.StartContinuousRecognition(); }
/// <summary> /// This method is called when the app first appears, but it also checks if it has been launched /// using Cortana's voice commands, and takes appropriate action if this is the case. /// </summary> protected async override void OnNavigatedTo(NavigationEventArgs e) { _dispatcher = CoreWindow.GetForCurrentThread().Dispatcher; _presence = new UserPresence(_dispatcher, _unfilteredName); _pageParameters = e.Parameter as VoiceCommandObjects.VoiceCommand; if (_pageParameters != null) { switch (_pageParameters.VoiceCommandName) { case "addNewNote": _activeNote = CreateNote(App.EVERYONE); break; case "addNewNoteForPerson": _activeNote = CreateNote(_pageParameters.NoteOwner); break; default: break; } } //Perform initialization for facial detection. if (AppSettings.FaceApiKey != "") { await FacialSimilarity.TrainDetectionAsync(); } // Perform initialization for speech recognition. _speechManager = new SpeechManager(FamilyModel); _speechManager.PhraseRecognized += speechManager_PhraseRecognized; _speechManager.StateChanged += speechManager_StateChanged; await _speechManager.StartContinuousRecognition(); }
private void UserFilterFromDetection(object sender, UserPresence.UserIdentifiedEventArgs e) { this.Public_ShowNotesForPerson(e.User); UpdateGreeting(e.User); }