FileUpdateRequestedEventArgs FileUpdateRequestedEventArgs FileUpdateRequestedEventArgs FileUpdateRequestedEventArgs Class

Definition

Provides information about a FileUpdateRequested event.

public : sealed class FileUpdateRequestedEventArgs : IFileUpdateRequestedEventArgs
public sealed class FileUpdateRequestedEventArgs : IFileUpdateRequestedEventArgs
Public NotInheritable Class FileUpdateRequestedEventArgs Implements IFileUpdateRequestedEventArgs
// This class does not provide a public constructor.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Examples

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


// Event handler
void CachedFileUpdaterUI_FileUpdateRequested(CachedFileUpdaterUI sender, FileUpdateRequestedEventArgs args)
{
    fileUpdateRequest = args.Request;
    fileUpdateRequestDeferral = fileUpdateRequest.GetDeferral();
    switch (cachedFileUpdaterUI.UIStatus)
    {
        case UIStatus.Hidden:
            fileUpdateRequest.Status = FileUpdateStatus.UserInputNeeded;
            fileUpdateRequestDeferral.Complete();
            break;
        case UIStatus.Visible:
            break;
        case UIStatus.Unavailable:
            fileUpdateRequest.Status = FileUpdateStatus.Failed;
            fileUpdateRequestDeferral.Complete();
            break;
    }
}

// Register for the event
cachedFileUpdaterUI.FileUpdateRequested += CachedFileUpdaterUI_FileUpdateRequested;

// Event handler
function onFileUpdateRequest(e) {
    fileUpdateRequest = e.request;
    fileUpdateRequestDeferral = fileUpdateRequest.getDeferral();

    switch (cachedFileUpdaterUI.uiStatus) {
        case Windows.Storage.Provider.UIStatus.hidden:
            fileUpdateRequest.status = Windows.Storage.Provider.FileUpdateStatus.userInputNeeded;
            fileUpdateRequestDeferral.complete();
            break;
        case Windows.Storage.Provider.UIStatus.visible:
            var url = scenarios[0].url;
            WinJS.Navigation.navigate(url, cachedFileUpdaterUI);
            break;
        case Windows.Storage.Provider.UIStatus.unavailable:
            fileUpdateRequest.status = Windows.Storage.Provider.FileUpdateStatus.failed;
            fileUpdateRequestDeferral.complete();
            break;
    }
}

// Register for the event
cachedFileUpdaterUI.addEventListener("fileupdaterequested", onFileUpdateRequest);

Both args and e (in C# and JS respectively) contain a FileUpdateRequestedEventArgs object.

Remarks

If your app participates in the Cached File Updater contract, a FileUpdateRequestedEventArgs is passed to your app's FileUpdateRequested event handler when the event fires. Use the FileUpdateRequestedEventArgs.Request property to get details about the requested update.

Properties

Request Request Request Request

Gets the details of the requested file update.

public : FileUpdateRequest Request { get; }
public FileUpdateRequest Request { get; }
Public ReadOnly Property Request As FileUpdateRequest
var fileUpdateRequest = fileUpdateRequestedEventArgs.request;
Value
FileUpdateRequest FileUpdateRequest FileUpdateRequest FileUpdateRequest

The details of the requested file update.