AppInstance.GetInstances Method

Definition

Retrieves a collection of all running instances of the app.

public:
 static IVector<AppInstance ^> ^ GetInstances();
/// [Windows.Foundation.Metadata.Experimental]
 static IVector<AppInstance> GetInstances();
 static IVector<AppInstance> GetInstances();
[Windows.Foundation.Metadata.Experimental]
public static IList<AppInstance> GetInstances();
public static IList<AppInstance> GetInstances();
function getInstances()
Public Shared Function GetInstances () As IList(Of AppInstance)

Returns

The collection of all running instances of the app.

Attributes

Remarks

Whereas the Windows.ApplicationModel.AppInstance.GetInstances method in the Windows OS only returns app instances that have explicitly registered for multi-instance redirection using the FindOrRegisterInstanceForKey method, this method in the Windows App SDK returns a list of all running app instances that have called any AppInstance method. Typically, an app instance will call AppInstance.GetCurrent, and this does two things: it adds the current instance to the list that will get returned by the GetInstances method, and it returns the current instance.

Applies to