CachedFileUpdaterActivatedEventArgs CachedFileUpdaterActivatedEventArgs CachedFileUpdaterActivatedEventArgs CachedFileUpdaterActivatedEventArgs Class

Definition

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.

public sealed class CachedFileUpdaterActivatedEventArgspublic sealed class CachedFileUpdaterActivatedEventArgsPublic NotInheritable Class CachedFileUpdaterActivatedEventArgspublic sealed class CachedFileUpdaterActivatedEventArgs
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

Learn more about providing updates for files that your app offers in the Quickstart: Providing file services through 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 value returned by the Kind property.

Apps written in JavaScript must listen for and handle Activated events.

Windows Store app 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(LaunchActivatedEventArgs), but defining overrides for other activation points such as OnCachedFileUpdaterActivated(CachedFileUpdaterActivatedEventArgs) is up to your app code.

All Application overrides involved in an activation scenario should call 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(CachedFileUpdaterActivatedEventArgs) override on the Application object references a CachedFileUpdaterActivatedEventArgs object. The OnCachedFileUpdaterActivated(CachedFileUpdaterActivatedEventArgs) 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.

Properties

CachedFileUpdaterUI CachedFileUpdaterUI CachedFileUpdaterUI CachedFileUpdaterUI

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

public CachedFileUpdaterUI CachedFileUpdaterUI { get; }public CachedFileUpdaterUI CachedFileUpdaterUI { get; }Public ReadOnly Property CachedFileUpdaterUI As CachedFileUpdaterUIpublic CachedFileUpdaterUI CachedFileUpdaterUI { get; }
Value
CachedFileUpdaterUI CachedFileUpdaterUI CachedFileUpdaterUI CachedFileUpdaterUI

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

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Kind Kind Kind Kind

Gets the activation type.

public ActivationKind Kind { get; }public ActivationKind Kind { get; }Public ReadOnly Property Kind As ActivationKindpublic ActivationKind Kind { get; }
Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

PreviousExecutionState PreviousExecutionState PreviousExecutionState PreviousExecutionState

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

public ApplicationExecutionState PreviousExecutionState { get; }public ApplicationExecutionState PreviousExecutionState { get; }Public ReadOnly Property PreviousExecutionState As ApplicationExecutionStatepublic ApplicationExecutionState PreviousExecutionState { get; }
Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

SplashScreen SplashScreen SplashScreen SplashScreen

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

public SplashScreen SplashScreen { get; }public SplashScreen SplashScreen { get; }Public ReadOnly Property SplashScreen As SplashScreenpublic SplashScreen SplashScreen { get; }
Value
SplashScreen SplashScreen SplashScreen SplashScreen

The object that provides splash screen information.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

User User User User

Gets the user that the app was activated for.

public User User { get; }public User User { get; }Public ReadOnly Property User As Userpublic User User { get; }
Value
User User User User

The user that the app was activated for.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

This property returns the logged-in user on platforms that only support single-user sessions. For platforms that support multiple users in a session (such as Xbox) this property returns the logged-in user that the app was activated for.

This property returns null when a multi-user application is activated with no specific user context.

Multi-user apps can use this property to allow or restrict app behavior. For example, you might restrict access to content or features based on the user’s credentials.