예제 #1
0
        private async void OnShareMenuClicked(object sender, RoutedEventArgs e)
        {
            var f = await NativeMethods.GetStorageFileFromPathAsync(PlaylistItem.Path) as StorageFile;

            if (f == null)
            {
                return;
            }
            var shareService = ShareServices.GetForCurrentView();

            shareService.PrecleanForSession();
            shareService.Title       = Title;
            shareService.Description = string.Empty;
            shareService.AddFile(f);
            shareService.ShowShareUI();
        }
예제 #2
0
        private async void Share(object obj)
        {
            var path = PlaybackControl.Instance.Current?.File.Path;

            if (path == null)
            {
                return;
            }
            var file = await NativeMethods.GetStorageFileFromPathAsync(path) as StorageFile;

            if (file == null)
            {
                return;
            }
            var shareService = ShareServices.GetForCurrentView();

            shareService.PrecleanForSession();
            shareService.Title       = NowPlayingTitle;
            shareService.Description = string.Empty;
            shareService.AddFile(file);
            shareService.ShowShareUI();
        }
        private async void OnMenuShareClicked(object sender, RoutedEventArgs e)
        {
            List <StorageFile> files = new List <StorageFile>();

            foreach (var file in Playlist.Items)
            {
                if (await NativeMethods.GetStorageFileFromPathAsync(file.Path) is StorageFile f)
                {
                    files.Add(f);
                }
            }
            if (files.Count == 0)
            {
                return;
            }
            var shareService = ShareServices.GetForCurrentView();

            shareService.PrecleanForSession();
            shareService.Title       = Playlist.Title;
            shareService.Description = string.Empty;
            shareService.AddFiles(files);
            shareService.ShowShareUI();
        }