Share via


PackageExtensionCatalog.PackageUpdating Event

Definition

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

// Register
event_token PackageUpdating(TypedEventHandler<PackageExtensionCatalog, PackageExtensionPackageUpdatingEventArgs const&> const& handler) const;

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

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

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 arguments, PackageExtensionPackageUpdatingEventArgs, only include the Package and the PackageExtensionName specified in the extension's Package.appxmanifest file as <uap17:PackageExtension 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 PackageExtensions 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 PackageExtensionCatalog.Open.

Applies to

See also