コード例 #1
0
        /// <summary>
        /// The save async method
        ///
        /// Saves the note and closes the new note window
        /// </summary>
        /// <returns>A task to save the note and close the new note page</returns>
        private async Task SaveAsync()
        {
            if (Title.Contains(":"))
            {
                await DisplayPopupHelpers
                .ShowOKDialogAsync("Invalid Title",
                                   "Title cannot include special character ':'");

                return;
            }

            string noteData = Title + ':' + Text;
            string fileName = IOHelpers.GetNewFileName();
            string color    = Color.ToHex();

            IOHelpers.SaveNoteData(fileName, noteData, color);

            await NavigationHelpers.PopCurrentPageAsync();
        }