Beispiel #1
0
        private async void EmptyRecycleBin()
        {
            MessageBoxResult dialogResult = await _feedbackService.ShowMessageAsync(Language["empty_recyclebin_confirmation"], Language["empty_recyclebin"], MessageBoxButtons.ContinueCancel, false);

            if (dialogResult != MessageBoxResult.Continue)
            {
                return;
            }

            if (RecycledNotes.Count > 0)
            {
                Modified = true;
            }
            RecycledNotes.Clear();

            // Search for all notes placed in the recycling bin
            for (int index = Model.Notes.Count - 1; index >= 0; index--)
            {
                NoteModel note = Model.Notes[index];
                if (note.InRecyclingBin)
                {
                    // Register the note as deleted and remove the note from the list
                    Model.DeletedNotes.Add(note.Id);
                    Model.Notes.Remove(note);
                }
            }

            // Reload empty page (but only if user confirmed command)
            _navigationService.Navigate(new Navigation(ControllerNames.RecycleBin));
        }
Beispiel #2
0
        private void EmptyRecycleBin()
        {
            if (RecycledNotes.Count > 0)
            {
                Modified = true;
            }
            RecycledNotes.Clear();

            // Search for all notes placed in the recycling bin
            for (int index = Model.Notes.Count - 1; index >= 0; index--)
            {
                NoteModel note = Model.Notes[index];
                if (note.InRecyclingBin)
                {
                    // Register the note as deleted and remove the note from the list
                    Model.DeletedNotes.Add(note.Id);
                    Model.Notes.Remove(note);
                }
            }
            OnPropertyChanged("Notes");
        }