CachedFileUpdaterActivatedEventArgs class
TOC
Collapse the table of content
Expand the table of content

CachedFileUpdaterActivatedEventArgs class

Provides information about the activated event that fires when the user saves or opens a file that needs updates from the app.

JavaScript:  This type appears as WebUICachedFileUpdaterActivatedEventArgs.

Syntax


Public NotInheritable Class CachedFileUpdaterActivatedEventArgs
    Implements ICachedFileUpdaterActivatedEventArgs, _
    IActivatedEventArgs

Members

The CachedFileUpdaterActivatedEventArgs class has these types of members:

Properties

The CachedFileUpdaterActivatedEventArgs class has these properties.

PropertyAccess typeDescription

CachedFileUpdaterUI

Read-only

Gets the letterbox UI of the file picker that is displayed when a file needs updates from the app.

Kind

Read-only

Gets the activation type.

PreviousExecutionState

Read-only

Gets the execution state of the app before it was activated.

SplashScreen

Read-only

Gets a SplashScreen object that provides information about the transition from the splash screen to the activated app.

User

Read-only

Gets the user that the app was activated for.

 

Remarks

Learn more about providing updates for files that your app offers in the Quickstart: Providing file services through file pickers and in the Windows.Storage.Pickers.Provider namespace reference.

A CachedFileUpdaterActivatedEventArgs object is passed to the app's activated event handler when the user saves a file that requires content management from the app. This type of activation is indicated by the ActivationKind.CachedFileUpdater value returned by the Kind property.

Apps written in JavaScript must listen for and handle Windows.UI.WebUI.WebUIApplication.activated events.

Windows Store apps using C++, C#, or Visual Basic typically implement activation points by overriding methods of the Application object. The default template app.xaml code-behind files always include an override for OnLaunched, but defining overrides for other activation points such as OnCachedFileUpdaterActivated is up to your app code.

All Application overrides involved in an activation scenario should call Window.Activate in their implementations.

Examples

The File picker contracts sample demonstrates how to respond to a CachedFileUpdater activation point.



// 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 C#, args for an OnCachedFileUpdaterActivated override on the Application object references a CachedFileUpdaterActivatedEventArgs object. The OnCachedFileUpdaterActivated override 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

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.ApplicationModel.Activation
Windows::ApplicationModel::Activation [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.ApplicationModel.Activation
Windows::ApplicationModel::Activation [C++]

Metadata

Windows.winmd

Attributes

[MarshalingBehavior(Agile)]
[Version(0x06020000)]

See also

Object
ICachedFileUpdaterActivatedEventArgs
IActivatedEventArgs
ActivationKind enumeration
Windows.Storage.Provider namespace
File picker contracts sample
Reference
Windows.UI.Core.CoreApplicationView.Activated event
OnCachedFileUpdaterActivated
Application

 

 

Show:
© 2017 Microsoft