private void OnDragStarting(UIElement sender, DragStartingEventArgs args)
        {
            IEnumerable <DbMediaFile> files = null;
            var _vm = DataContext as CommonViewItemModel;

            switch (_vm.Type)
            {
            case CommonItemType.Album:
                files = _vm.InternalDbEntityId.GetAlbumById()
                        .MediaFiles
                        .OrderBy(c => c.DiscNumber)
                        .ThenBy(c => c.TrackNumber);
                break;

            case CommonItemType.Artist:
                files = _vm.InternalDbEntityId.GetArtistById()
                        .MediaFiles
                        .OrderBy(c => c.Album)
                        .ThenBy(c => c.DiscNumber)
                        .ThenBy(c => c.TrackNumber);
                break;
            }
            if (files != null)
            {
                args.DragUI.SetContentFromDataPackage();
                args.Data.RequestedOperation = DataPackageOperation.Copy;
                args.Data.SetText(DragHelper.Add(files));
            }
        }
        private void OnDragStarting(UIElement sender, DragStartingEventArgs args)
        {
            var playlist = (sender as FrameworkElement).DataContext as Playlist;

            args.DragUI.SetContentFromDataPackage();
            args.Data.RequestedOperation = DataPackageOperation.Copy;
            args.Data.SetText(DragHelper.Add(playlist));
        }
Exemple #3
0
 private void OnDragStarting(UIElement sender, DragStartingEventArgs args)
 {
     args.DragUI.SetContentFromDataPackage();
     args.Data.RequestedOperation = DataPackageOperation.Copy;
     args.Data.SetText(DragHelper.Add(File));
 }