private void OpenLocalMusicFlyout(object sender, object e) { if (History.Count == 0) { return; } var tree = History.Peek(); var flyout = sender as MenuFlyout; flyout.Items.Clear(); var helper = new MenuFlyoutHelper() { Data = tree.Files, DefaultPlaylistName = tree.Directory }; flyout.Items.Add(helper.GetAddToMenuFlyoutSubItem()); flyout.Items.Add(MenuFlyoutHelper.GetShowInExplorerItem(tree.Path, StorageItemTypes.Folder)); flyout.Items.Add(MenuFlyoutHelper.GetSortByMenuSubItem(new Dictionary <SortBy, Action> { { SortBy.Title, () => { if (LocalFrame.Content is LocalMusicPage page) { page.SortByTitle(); } else { LocalMusicPage.SortByTitleRequested = !LocalMusicPage.SortByTitleRequested; } } },
private void OpenPlaylistFlyout(object sender, object e) { var flyout = sender as MenuFlyout; MenuFlyoutHelper.SetPlaylistMenu(sender, this, null, new MenuFlyoutOption { MultiSelectOption = new MultiSelectCommandBarOption { ShowRemove = false, ShowReverseSelection = false } }); FolderTree tree = null; if (flyout.Target.DataContext is GridFolderView gridFolderView) { tree = gridFolderView.Tree; } else if (flyout.Target.DataContext is TreeViewNode node) { tree = node.Content as FolderTree; } flyout.Items.Add(MenuFlyoutHelper.GetShowInExplorerItem(tree.Path, Windows.Storage.StorageItemTypes.Folder)); flyout.Items.Add(MenuFlyoutHelper.GetRefreshDirectoryItem(tree, AfterTreeUpdated)); flyout.Items.Add(MenuFlyoutHelper.GetSearchDirectoryItem(tree)); }