CachedFileUpdaterUI class

Applies to Windows and Windows Phone

Used to interact with the file picker if your app provides file updates through the Cached File Updater contract.

Syntax


var cachedFileUpdaterUI = Windows.UI.WebUI.webuiCachedFileUpdaterActivatedEventArgs.cachedFileUpdaterUI;

Attributes

[Version(0x06020000)]

Members

The CachedFileUpdaterUI class has these types of members:

Events

The CachedFileUpdaterUI class has these events.

EventDescription
FileUpdateRequested Fires when the Windows requests a file update.
UIRequested Fires when the calling app needs to display the file picker letterbox UI that is represented by the CachedFileUpdaterUI object.

 

Methods

The CachedFileUpdaterUI class inherits methods from the Object class (C#/VB/C++).

Properties

The CachedFileUpdaterUI class has these properties.

PropertyAccess typeDescription

Title

Read/writeGets or sets the title to display in the top-left the file picker UI. The title identifies the location or context of the app's page (which is hosted in the file picker UI) for the user.

UIStatus

Read-onlyGets an enum value that indicates the status of the file picker UI.

UpdateTarget

Read-onlyGets a value that indicates which version of the file needs to be updated: the local version or the version in the app's repository.

 

Remarks

In JavaScript, retrieve a CachedFileUpdaterUI object using the webuiCachedFileUpdaterActivatedEventArgs.cachedFileUpdaterUI property.

In C#, C++, and VB, retrieve a CachedFileUpdaterUI object using the CachedFileUpdaterActivatedEventArgs.CachedFileUpdaterUI property.

Examples

The File picker contracts sample demonstrates how to respond to a cachedFileUpdater activated event.



// cachedFileUpdater activated event handler
function activated(eventObject) {
        // Identify whether app was launched for cachedFileUpdater
        if (eventObject.detail.kind === Windows.ApplicationModel.Activation.ActivationKind.cachedFileUpdater) {
            // Perform tasks to prepare your app to display its file picker page

            // Get file picker UI
            cachedFileUpdaterUI = eventObject.detail.cachedFileUpdaterUI;

            cachedFileUpdaterUI.addEventListener("fileupdaterequested", onFileUpdateRequest);
            cachedFileUpdaterUI.addEventListener("uirequested", onUIRequested);

            switch (cachedFileUpdaterUI.updateTarget) {
                case Windows.Storage.Provider.CachedFileTarget.local:
                    scenarios = [{ url: "/html/cachedFileUpdaterScenario1.html", title: "Get latest version" }];
                    break;
                case Windows.Storage.Provider.CachedFileTarget.remote:
                    scenarios = [{ url: "/html/cachedFileUpdaterScenario2.html", title: "Remote file update" }];
                    break;
            }
            SdkSample.scenarios = scenarios;
        }
    }

// Register the activated event handler
WinJS.Application.addEventListener("activated", activated, false);

For JavaScript, eventObject contains a webUICachedFileUpdaterActivatedEventArgs object.

For C#, args contains a CachedFileUpdaterActivatedEventArgs object. Additionally, the OnCachedFileUpdaterActivated is in the App.xaml.cs file and the Activate method is in the CachedFileUpdaterPage.xaml.cs file of the File picker contracts sample.

Requirements

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.Storage.Provider
Windows::Storage::Provider [C++]

Metadata

Windows.winmd

 

 

Show:
© 2014 Microsoft