Windows.Storage.Pickers.FileOpenPicker.PickMultipleFilesAsync C# (CSharp) Method

PickMultipleFilesAsync() public method

public PickMultipleFilesAsync ( ) : IAsyncOperation>
return IAsyncOperation>
		public extern IAsyncOperation<IVectorView<StorageFile>> PickMultipleFilesAsync();
	}

Usage Example

Esempio n. 1
0
        async private System.Threading.Tasks.Task SetLocalMedia()
        {
            var openPicker = new Windows.Storage.Pickers.FileOpenPicker();

            openPicker.FileTypeFilter.Add(".wmv");
            openPicker.FileTypeFilter.Add(".mp4");
            openPicker.FileTypeFilter.Add(".wma");
            openPicker.FileTypeFilter.Add(".mp3");


            var file = await openPicker.PickMultipleFilesAsync();

            // mediaPlayer is a MediaPlayerElement defined in XAML
            if (file != null)
            {
                bool first = false;
                foreach (var f in file)
                {
                    if (!first)
                    {
                        VideoFileInfoList.Add(new VideoFileInfoData(f.Name, f.Path));;


                        mediaPlayer.Source = MediaSource.CreateFromStorageFile(f);

                        mediaPlayer.MediaPlayer.Play();

                        first = true;
                    }
                }
            }
        }
All Usage Examples Of Windows.Storage.Pickers.FileOpenPicker::PickMultipleFilesAsync