Dela via


Package.SetInUseAsync(Boolean) Method

Definition

Sets whether the package is in use or not.

public:
 virtual IAsyncOperation<bool> ^ SetInUseAsync(bool inUse) = SetInUseAsync;
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<bool> SetInUseAsync(bool const& inUse);
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<bool> SetInUseAsync(bool inUse);
function setInUseAsync(inUse)
Public Function SetInUseAsync (inUse As Boolean) As IAsyncOperation(Of Boolean)

Parameters

inUse
Boolean

bool

True to specify that the package is in use; false otherwise.

Returns

True indicates that the operation to set whether the package is in use or not was successful; false otherwise.

Attributes

Windows requirements

Device family
Windows 10 Creators Update (introduced in 10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v4.0)

Remarks

This API specifies whether the app is using an optional package. With this information the system can determine whether servicing the optional package will require shutting down the app. This provides a better user experience because the app can manage when it is shut down for optional package updates or removals.

By default, all optional packages are in use. Servicing an optional package causes the app to shut down. To avoid shutting down the app when an optional package that is not being used is updated or removed, call this API with inUse set to false.

Applies to