Runtime Connection Migration
Connecting to the Runtime
The new adapter uses a fluent builder style of runtime creation, similiar to how frameworks such as ASP.NET Core now work.
Runtime runtime = Runtime.GetRuntimeInstance(new RuntimeOptions
{
Version = "stable",
UUID = "the-app-uuid",
LicenseKey = "your-license-key"
});
runtime.Error += (sender, e) => {
// Handle any connection errors...
};
runtime.Connect(() =>
{
// Now connected
// Note: The callback is invoked on another thread so any UI access must be marshalled to the main thread
App.Current.Dispatcher.BeginInvoke(() =>
{
status.Content = "Connected";
});
// Do stuff with the runtime...
});