Exemplo n.º 1
0
        /// <summary>
        /// Delete Notebook
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        async private void btnDelete_Click(object sender, RoutedEventArgs e)
        {
            var result = await Helpers.ShowDialog("Are you sure you want to delete this NoteBook?", "Delete NoteBook");

            if (result)
            {
                await NotesDataSource.DeleteAsync(notebook);

                var frame = new Frame();
                frame.Navigate(typeof(GroupedItemsPage));
                Window.Current.Content = frame;
            }
        }
        // LAB #9 TILES

        #endregion

        /// <summary>
        /// Show confirmation message for deleting Note, if the user choose Yes then delete note and return to GroupDetailPage based on deleted note Notebook.
        /// </summary>
        /// <param name="command"></param>
        async void DeleteAsync(object command)
        {
            var result = await Helpers.ShowDialog("Are you sure you want to delete this Note?", "Delete Note");

            if (result)
            {
                _printer.UnregisterForPrinting();
                await NotesDataSource.DeleteAsync(Note);

                // LAB #9 TILES
                var frame = new Frame();
                frame.Navigate(typeof(GroupedItemsPage));
                frame.Navigate(typeof(GroupDetailPage), Note.NoteBook.UniqueId);
                Window.Current.Content = frame;
            }
        }