/// <summary> /// Called when user interacted with session notification /// </summary> /// <param name="action">The action user has made</param> private void NotificationRequest(AppAction action) { // Fire proper command based on the action // So clicking on the notification has the exact same effect as clicking on the page switch (action) { case AppAction.NextSessionTask: { mSessionHandler.Finish(); } break; case AppAction.PauseSession: { mSessionHandler.Pause(); } break; case AppAction.ResumeSession: { mSessionHandler.Resume(); } break; case AppAction.StopSession: { mSessionHandler.EndSession(); } break; } }
/// <summary> /// Ends current user session, if he decides to /// </summary> private async void EndSessionAsync() { // Ask the user if he's certain to end the session var popupViewModel = new PopupMessageViewModel ( LocalizationResource.SessionFinished, LocalizationResource.QuestionAreYouSureToFinishSession, LocalizationResource.Yes, LocalizationResource.No ); var userResponse = await mUIManager.DisplayPopupMessageAsync(popupViewModel); // If he agreed... if (userResponse) { // End the session mSessionHandler.EndSession(); } }