AppInstance.IsCurrentInstance Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Whether the current instance of the app is the registered instance of the app for the specific key that this instance has defined.
public:
property bool IsCurrentInstance { bool get(); };
bool IsCurrentInstance();
public bool IsCurrentInstance { get; }
var boolean = appInstance.isCurrentInstance;
Public ReadOnly Property IsCurrentInstance As Boolean
Property Value
bool
A Boolean that indicates whether the current app is the registered instance of the app.
Examples
In the following example, if the instance found is the current instance, that instance is activated. If it is not the current instance, the example redirects to the app instance that is found.
if (theInstance.IsCurrentInstance)
{
global::Windows.UI.Xaml.Application.Start((p) => new App(activatedArgs));
}
else
{
theInstance.RedirectActivationTo();
}