Skip to main content

PolymerComponent

Namespace: Wisej.Web.Ext.Polymer

Assembly: Wisej.Web.Ext.Polymer (4.1.0.0)

Represents a Polymer (www.polymer-project) non-visual component. Used to import polymer libraries, such as iron-icons sets and others.

public class PolymerComponent : Component, IComponent

The libraries listed in Imports are imported in the browser using <link rel="import"> elements. Each library is loaded only once per browser page.

Example:

Importing the iron-icons sets used by PolymerWidget controls:

var polymerComponent = new PolymerComponent(this.components)
{
Imports = new[]
{
"iron-icons/iron-icons.html",
"iron-icons/social-icons.html"
}
};

Constructors​

Instance member PolymerComponent()​

Initializes a new instance of the PolymerComponent class.

Instance member PolymerComponent(container)​

Initializes a new instance of the PolymerComponent class together with the specified container.

NameTypeDescription
containerIContainerA IContainer that represents the container for the component.

Throws:

Properties​

Protected member DesignMode​

Boolean: Returns a value that indicates whether the IComponent is currently in design mode.

Value: true if the IComponent is in design mode; otherwise, false.

Instance member Imports​

String[]: Returns or sets the list of polymer libraries to import. (Default: null)

Each entry is either an absolute URL (starting with http: or https:) or a path relative to PolymerBaseUrl. Libraries already loaded in the browser are not loaded again.

Example:

Importing a relative and an absolute library:

this.polymerComponent1.Imports = new[]
{
"iron-icons/maps-icons.html",
"https://cdn.example.com/elements/my-element.html"
};

Static member PolymerBaseUrl​

String: Returns or sets the base URL for the polymer files.

Relative entries in Imports and the elements created by PolymerWidget are loaded from this URL; it must end with a slash. The default is "https://wisej.s3.amazonaws.com/libs/polymers/". This is a static setting shared by all sessions, but the new value is sent only to the browser of the current session: set it before creating any Polymer control, i.e. in Program.Main, for every session. A null value is converted to an empty string.

Example:

Loading the Polymer libraries from the application's own folder:

static void Main()
{
PolymerComponent.PolymerBaseUrl = "https://myapp.example.com/polymer/";
new MainPage().Show();
}

Methods​

Protected member OnWebRender(config)​

Renders the client component.

ParameterTypeDescription
configObjectDynamic configuration object.

Implements​