/// <summary> /// User clicked on "Move" appbar button, this method will build and display a popup menu with list of Notebooks. /// Allowing the user target notebook. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> async void btnMoveNotebookClick(object sender, RoutedEventArgs e) { PopupMenu nbMenu = new PopupMenu(); var nbs = NotesDataSource.GetGroups(); foreach (NoteBook nb in nbs) { if (!nb.UniqueId.Equals(Note.NoteBookUniqueId)) { nbMenu.Commands.Add(new UICommand(nb.Title, null, nb.UniqueId)); } } var rect = Helpers.GetElementRect((FrameworkElement)sender); IUICommand command = await nbMenu.ShowForSelectionAsync(rect); if (command == null) { return; } var result = await Helpers.ShowDialog(string.Format(Consts.MoveNote, Note.NoteBook.Title, command.Label), "Move Note"); var nbUniqueId = (string)command.Id; if (result) { NotesDataSource.Move(Note.UniqueId, nbUniqueId); DrawDefaultAppBar(); } }