将新项添加到网格

时间:2014-07-30 11:51:02

标签: c# windows-8.1

我正在尝试从您的电脑导入音乐文件以制作您自己的播放列表。 代码如下:

    public async void Button_Click(object sender, RoutedEventArgs e) // Pick directory
    {
     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.PickSingleFileAsync();
     var stream = await file.OpenAsync(Windows.Storage.FileAccessMode.Read);

     // media is a MediaElement defined in XAML 
     if (null != file)
        {
          media.SetSource(stream, file.ContentType);
          media.Play();
        }
    }
    private async void Button_Click_1(object sender, RoutedEventArgs e) //Import file
    {
        this.Frame.Navigate(typeof(importedfile));
        importedfile import = new importedfile(); // The imported file goes to that page.  
        //What do I do to get the imported file into a new grid (Picture below
    }

例如:我导入一首歌,然后按下导入按钮,它将导航到导入的文件页面,但我接下来该怎么办? enter image description here

0 个答案:

没有答案