private void ShowSingleNotes()
 {
     foreach (var note in Notes)
     {
         var window = new SingleNoteWindow(note);
         window.Show();
         singleNoteWindows.Add(window);
     }
 }
        public async void GetAllNotes(bool showSingleNotes)
        {
            getToken();
            LoggedUser = await methods.GetUserInfo(token, _authenticationRecord.Email);

            noteApi = new NoteApi(_authenticationRecord, LoggedUser.Id);
            try
            {
                IEnumerable <Note> tempNotes = await noteApi.GetAllNotesAsync();

                IEnumerable <Note> tempSortedNotes = tempNotes.OrderByDescending <Note, DateTime>(o => o.CreateTimestamp).ToList();

                Notes.Clear();
                singleNotes.Clear();
                foreach (var note in tempSortedNotes)
                {
                    Notes.Add(note);
                    singleNotes.Add(note);
                }

                foreach (var note in Notes)
                {
                    note.CreateTimestamp     = note.CreateTimestamp.ToLocalTime();
                    note.LastChangeTimestamp = note.LastChangeTimestamp.ToLocalTime();
                    if (showSingleNotes == true)
                    {
                        var window = new SingleNoteWindow(note);
                        window.Show();
                        singleNoteWindows.Add(window);
                    }
                }
            }
            catch (Exception e)
            {
                MessageBox.Show("An error has occured." + e.Message);
                return;
            }
        }