AppExtensionCatalog.PackageUpdating Event

Definition

Event that is fired when an extension package is being updated.

// Register
event_token PackageUpdating(TypedEventHandler<AppExtensionCatalog, AppExtensionPackageUpdatingEventArgs const&> const& handler) const;

// Revoke with event_token
void PackageUpdating(event_token const* cookie) const;

// Revoke with event_revoker
AppExtensionCatalog::PackageUpdating_revoker PackageUpdating(auto_revoke_t, TypedEventHandler<AppExtensionCatalog, AppExtensionPackageUpdatingEventArgs const&> const& handler) const;
public event TypedEventHandler<AppExtensionCatalog,AppExtensionPackageUpdatingEventArgs> PackageUpdating;
function onPackageUpdating(eventArgs) { /* Your code */ }
appExtensionCatalog.addEventListener("packageupdating", onPackageUpdating);
appExtensionCatalog.removeEventListener("packageupdating", onPackageUpdating);
- or -
appExtensionCatalog.onpackageupdating = onPackageUpdating;
Public Custom Event PackageUpdating As TypedEventHandler(Of AppExtensionCatalog, AppExtensionPackageUpdatingEventArgs) 

Event Type

Remarks

This event marks when a package update has started. It precedes the PackageUpdated event. In most cases, treat this as you do PackageUninstalling.

A good way to handle this event is to treat the associated extensions within the package as unavailable when you handle PackageUpdating, and then reload them when you handle the PackageUpdated event. The time between these two events is typically less than a second.

The event argument, AppExtensionPackageUpdatingEventArgs.Extensions, only includes the Package and the extension namespace name specified in the extension's Package.appxmanifest file as <uap3:AppExtension Name=...>. It doesn't contain the list of extensions.

When you handle the PackageUpdating event, match the package that is being updated against any extensions that you have loaded from that package so that you can keep track of which extensions are now available. This is why you should keep track of the AppExtensions that you have loaded, the packages to which they belong, and a unique identifier for them that you can use as a key as described in the remarks for AppExtensionCatalog.Open.

Applies to