private async Task OnSectionCreated(SectionCreated msg) { var notebooks = await _notebook.GetNotebooks(); var selectedNotebook = Notebooks.Single(n => n.IsSelected); await DoOnUiDispatcherAsync(() => { Notebooks.Clear(); notebooks.ForEach(n => { if (n.Id == selectedNotebook.Id) { n.Select(); } Notebooks.Add(n); }); }); }
private async Task OnPageCreated(PageCreated msg) { var notebooks = await _notebook.GetNotebooks(); var selectedSection = Sections.Single(s => s.IsSelected); var updatedParentNotebook = notebooks.Single(n => n.Id == selectedSection.ParentNotebook.Id); await DoOnUiDispatcherAsync(() => { Sections.Clear(); updatedParentNotebook.Sections.ForEach(s => { if (s.Id == selectedSection.Id) { s.Select(); } Sections.Add(s); }); }); }