CachedFileUpdaterUI class

CachedFileUpdaterUI class

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

Syntax


public sealed class CachedFileUpdaterUI

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/write

Gets 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-only

Gets an enum value that indicates the status of the file picker UI.

UpdateTarget

Read-only

Gets 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
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();
        }

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 (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0 [for Xbox, see UWP features that aren't yet supported on Xbox]

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

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

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

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

Attributes

[Version(0x06020000)]

See also

Object
File picker provider sample (Windows 10)

 

 

Show:
© 2017 Microsoft