Instance. Find OrRegister Instance For Key(String) Method
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.
Registers an app instance with the platform, or finds an existing instance if another instance has already registered this key.
public: static AppInstance ^ FindOrRegisterInstanceForKey(Platform::String ^ key);
static AppInstance FindOrRegisterInstanceForKey(winrt::hstring const& key);
public static AppInstance FindOrRegisterInstanceForKey(string key);
Public Shared Function FindOrRegisterInstanceForKey (key As String) As AppInstance
A non-empty string as a key for the instance.
An app instance that represents the first app that registered the key. The caller can determine whether that instance is the current instance.
This example returns the instance registered for the specified key. If there was no existing app instance for that key, the method registers the current instance, and returns that instance.
theInstance = AppInstance.FindOrRegisterInstanceForKey(key);
After an app has registered with the platform, it is returned when other instances query for app instances.
An app instance can register multiple times with different keys. The system cache maintains one row per instance, therefore, the key is overwritten.
Submit and view feedback for