WinForms Embedded View

API Docs NuGet Example Project


The WinForms Embedded View Control allows you to embed a OpenFin Web view within a Windows Forms application. Integrating HTML 5 seamlessly in the host application you can use the InterApplication bus for communication or leverage the RVM to easily upgrade the OpenFin WebView without having to re-deploy the host application.

Please include your licenseKey in RuntimeOptions.LicenseKey when launching apps from the .NET Adapter. If you’re interested in an Enterprise license, please contact us for one here.

All classes are defined in theOpenfin.WinForm namespace.

Just Include the Openfin.WinForm namespace.

using System;
using System.Windows.Forms;
using Openfin.WinForm;
namespace WinForms.Test
    public partial class Form1 : Form

Then place an EmbeddedView control in the screen.

var OpenFinEmbeddedView = new EmbeddedView();

Runtime options

As the .NET API, we use the Runtime Options object to specify target runtime (alpha, beta, 32/64 bits…etc), enabling remote debugging, specify local assets…etc, for a complete list of options see our documentation.

var runtimeOptions = new Openfin.Desktop.RuntimeOptions
    Version = "alpha",
    EnableRemoteDevTools = true,
    RemoteDevToolsPort = 9090

Application options

The Application Options object allows you to configure the OpenFin Application being embedded, options include: name, URL, icon and window options…etc, for a complete list of options see our documentation.

var appOptions = new Openfin.Desktop.ApplicationOptions("of-chart", 
    "of-chart-uuid", "");


The EmbeddedView needs to be initialized with both the RuntimeOptions object and the ApplicationOptions object.

OpenFinEmbeddedView.Initialize(runtimeOptions, appOptions);


To programmatically react to when the EmbeddedView has loaded its content and is ready to be displayed, you can subscribe to the Ready event:

OpenFinEmbeddedView.Ready += (sender, e) =>
    // EmbeddedView events are automatically raised on the UI thread
    Text = "OpenFinEmbeddedView is ready";

Embedding child windows

The OpenFinEmbeddedView allows you to embed web applications, these have their own render process and sandbox, but it also allows you to embed child windows that can share the same render process and sandbox, adding the risk of one window crashing the other but using less resources.

OpenFinEmbeddedView.Ready += (sender, e) =>
    //We need to create our WindowOptions Object
    var windowOptions = new Openfin.Desktop.WindowOptions("jsdocs", "");

    //Assuming we have added a second EmbeddedView called OpenFinEmbeddedViewChild
    //we initialize it.
        OpenFinEmbeddedView.OpenfinApplication, windowOptions)

Runtime object

Every EmbeddedView control that shares a RuntimeOptions object shares a connection to the OpenFin Runtime. You can obtain this singleton object via the Runtime.GetRuntimeInstance function. It allows you to publish and subscribe to Inter Application Bus messages, react to disconnect events, and initiate connect calls (this is optional and unnecessary in the case where one or more EmbeddedView control has been initialized).

var runtime = Runtime.GetRuntimeInstance(runtimeOptions);
runtime.Connect(() => 
    //Any Interactions with the UI must be done in the right thread.
    Openfin.WPF.Utils.InvokeOnUiThreadIfRequired(this, () => 
        Text = "OpenFin Runtime is connected");

    //subscribe to hello-from-bus messages from any application
    InterApplicationBus.Subscription<JObject>(runtime, "hello-from-bus").MessageReceived += (s, e) =>
        var dataAsJObject = e.Message;
        Openfin.WinForm.Utils.InvokeOnUiThreadIfRequired(this, () =>
            Title = dataAsJObject.GetValue("message"));

Have questions? Get in touch with us at

WinForms Embedded View

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.