Package.SetInUseAsync(Boolean) Package.SetInUseAsync(Boolean) Package.SetInUseAsync(Boolean) Package.SetInUseAsync(Boolean) Package.SetInUseAsync(Boolean) Method

Definition

Sets whether the package is in use or not.

public : IAsyncOperation<Platform::Boolean> SetInUseAsync(bool inUse)
IAsyncOperation<bool> SetInUseAsync(bool inUse) const;
public IAsyncOperation<bool> SetInUseAsync(Boolean inUse)
Public Function SetInUseAsync(inUse As Boolean) As IAsyncOperation(Of bool)
Windows.ApplicationModel.Package.setInUseAsync(inUse).done( /* Your success and error handlers */ );

Parameters

inUse
Boolean Boolean Boolean

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.

Additional features and requirements

Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

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.