【问题标题】:FileSavePicker task not showing in Window.Storage.Pickers in wp8 c#FileSavePicker 任务未显示在 wp8 c# 的 Window.Storage.Pickers 中
【发布时间】:2015-05-25 12:46:55
【问题描述】:

我正在尝试使用 FilePicker 任务保存视频文件,但它没有在解决方案中显示 FileSavePicker 任务。下面附上截图

Windows.Storage.Pickers 中只显示 4 个任务

  1. 文件扩展向量
  2. FileOpenPicker
  3. PickerLocationId
  4. PickerViewMode

这是我正在使用的代码

        async void TrimVideoFile()
    {
        Windows.Storage.StorageFile source;
        Windows.Storage.StorageFile destination;

        var openPicker = new Windows.Storage.Pickers.FileOpenPicker();

        openPicker.SuggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.VideosLibrary;
        openPicker.FileTypeFilter.Add(".wmv");
        openPicker.FileTypeFilter.Add(".mp4");

        source = await openPicker.PickSingleFileAsync();

        var savePicker = new Windows.Storage.Pickers.FileSavePicker()
        savePicker.SuggestedStartLocation =
            Windows.Storage.Pickers.PickerLocationId.VideosLibrary;

        savePicker.DefaultFileExtension = ".mp4";
        savePicker.SuggestedFileName = "New Video";

        savePicker.FileTypeChoices.Add("MPEG4", new string[] { ".mp4" });

        destination = await savePicker.PickSaveFileAsync();

        // Method to perform the transcoding.
        TrimFile(source, destination);
    }

它只显示 4 个任务。如何使用 FileSavePicker 任务。我正在使用 Visual Studio 2012,我的目标应用是 Windows Phone 8.0 应用。

【问题讨论】:

    标签: c# windows-phone-8 filesavepicker


    【解决方案1】:

    文件选择器在 Windows Phone 8 上不可用。它们是随 Windows Phone 8.1 添加的。

    请参阅 MSDN 上 FileSavePicker docs 中的版本部分:

    最低支持手机 Windows Phone 8.1 [Windows Phone Silverlight 8.1 和 Windows 运行时应用]

    【讨论】:

    • WindowPhone8 中的 FileSavePicker 有什么替代品吗?
    • 没有。它们是 8.1 的新功能。您可以编写自己的选择 UI,但它只能定位应用已经可以读取的位置。
    猜你喜欢
    • 2017-07-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-09-08
    • 1970-01-01
    • 2018-08-11
    • 2015-09-06
    相关资源
    最近更新 更多