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.
- C#
- VB.NET
public class PolymerComponent : Component, IComponent
Public Class PolymerComponent
Inherits Component
Implements 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
PolymerComponent()
Initializes a new instance of the PolymerComponent class.
PolymerComponent(container)
Initializes a new instance of the PolymerComponent class together with the specified container.
| Name | Type | Description |
|---|---|---|
| container | IContainer | A IContainer that represents the container for the component. |
Throws:
- ArgumentNullException container is null.
Properties
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.
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"
};
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
OnWebRender(config)
Renders the client component.
| Parameter | Type | Description |
|---|---|---|
| config | Object | Dynamic configuration object. |
Implements
| Name | Description |
|---|---|
| IUserData | |
| IWisejComponent | |
| IWisejSerializable |