/// <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();
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Cancels current task creation and goes back to previous page
        /// </summary>
        private async void CancelAndBackAsync()
        {
            // Warn the user about unsaved changes
            var viewModel = new PopupMessageViewModel
                            (
                LocalizationResource.UnsavedChanges,
                LocalizationResource.AreYouSure,
                LocalizationResource.Yes,
                LocalizationResource.No
                            );
            var userResponse = await mUIManager.DisplayPopupMessageAsync(viewModel);

            // If he agreed to discard changes...
            if (userResponse)
            {
                // Go back to previous page
                await mUIManager.GoBackToPreviousPage(this);
            }
        }