CachedFileUpdaterUI クラス

定義

キャッシュされたファイル アップデーター コントラクトを通じてアプリがファイルの更新を提供する場合に、ファイル ピッカーと対話するために使用されます。

public ref class CachedFileUpdaterUI sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
class CachedFileUpdaterUI final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
public sealed class CachedFileUpdaterUI
Public NotInheritable Class CachedFileUpdaterUI
継承
Object Platform::Object IInspectable CachedFileUpdaterUI
属性

Windows の要件

デバイス ファミリ
Windows 10 (10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox で導入)
API contract
Windows.Foundation.UniversalApiContract (v1.0 で導入)

ファイル ピッカー コントラクトのサンプルでは、CachedFileUpdater アクティブ化イベントに応答する方法を示します。

// CachedFileUpdater activated event handler
protected override void OnCachedFileUpdaterActivated(CachedFileUpdaterActivatedEventArgs args)
{
    var CachedFileUpdaterPage = new SDKTemplate.CachedFileUpdaterPage();
    CachedFileUpdaterPage.Activate(args);
}

// Overloaded method to respond to CachedFileUpdater events
public void Activate(CachedFileUpdaterActivatedEventArgs args)
{
            // Get file picker UI
            cachedFileUpdaterUI = args.CachedFileUpdaterUI;

            cachedFileUpdaterUI.FileUpdateRequested += CachedFileUpdaterUI_FileUpdateRequested;
            cachedFileUpdaterUI.UIRequested += CachedFileUpdaterUI_UIRequested;

            switch (cachedFileUpdaterUI.UpdateTarget)
            {
                case CachedFileTarget.Local:
                    scenarios = new List<Scenario> { new Scenario() { Title = "Get latest version", ClassType = typeof(FilePickerContracts.CachedFileUpdater_Local) } };
                    break;
                case CachedFileTarget.Remote:
                    scenarios = new List<Scenario> { new Scenario() { Title = "Remote file update", ClassType = typeof(FilePickerContracts.CachedFileUpdater_Remote) } };
                    break;
            }

            Window.Current.Activate();
        }

C# の場合、 args には CachedFileUpdaterActivatedEventArgs オブジェクトが 含まれます。 さらに、 OnCachedFileUpdaterActivated は App.xaml.cs ファイルにあり、 Activate メソッドは ファイル ピッカー コントラクト サンプルの CachedFileUpdaterPage.xaml.cs ファイルにあります。

注釈

CachedFileUpdaterActivatedEventArgs.CachedFileUpdaterUI プロパティを使用して CachedFileUpdaterUI オブジェクトを取得します。

プロパティ

Title

ファイル ピッカー UI の左上に表示するタイトルを取得または設定します。 タイトルは、ユーザーのアプリのページ (ファイル ピッカー UI でホストされている) の場所またはコンテキストを識別します。

UIStatus

ファイル ピッカー UI の状態を示す列挙値を取得します。

UpdateRequest

キャッシュされたファイル アップデーターによって現在処理されているファイル更新要求を取得します。

UpdateTarget

更新する必要があるファイルのバージョン (アプリのリポジトリ内のローカル バージョンまたはバージョン) を示す値を取得します。

メソッド

GetDeferral()

ファイル更新要求を非同期的に完了するために使用される オブジェクトを取得します。

イベント

FileUpdateRequested

Windows がファイルの更新を要求すると発生します。 このイベントは、要求された更新ごとに 1 回発生します。

UIRequested

呼び出し元アプリが CachedFileUpdaterUI オブジェクトによって表されるファイル ピッカーレターボックス UI を表示する必要がある場合に発生します。

サーバーは、このイベントを受信するまで UI の初期化を延期できます。

適用対象

こちらもご覧ください