Esempio n. 1
0
 public async void deleteMusicLibFolder(LibFolder folder)
 {
     if (await musicLib.RequestRemoveFolderAsync(folder.StorageFolder))
     {
         LibFolders.Remove(folder);
         MusicItems.Clear();
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Requests the user's permission to remove the selected location from the Pictures library.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private async void RemoveFolderButton_Click(object sender, RoutedEventArgs e)
        {
            var folderToRemove = (StorageFolder)FoldersComboBox.SelectedItem;

            if (await picturesLibrary.RequestRemoveFolderAsync(folderToRemove))
            {
                OutputTextBlock.Text = folderToRemove.DisplayName + " was removed from the Pictures library.";
            }
            else
            {
                OutputTextBlock.Text = "Operation canceled.";
            }
        }
Esempio n. 3
0
        private async void removeButton_Click(object sender, RoutedEventArgs e)
        {
            FrameworkElement element = (FrameworkElement)sender;
            StorageFolder    folder  = element.DataContext as StorageFolder;

            StorageLibrary musicLibrary = await StorageLibrary.GetLibraryAsync(KnownLibraryId.Music);

            bool result = await musicLibrary.RequestRemoveFolderAsync(folder);

            if (result)
            {
                LoadFolders();
                Collection.LoadCollectionChanges();
            }
        }