CustomElement Class
The .NET object of a custom element defined with a CustomElementConstructor. The virtual methods are the lifecycle callbacks of the custom element (https://html.spec.whatwg.org/multipage/custom-elements.html#custom-element-reactions).
public abstract class CustomElementConstructors
| Name | Description |
|---|---|
| CustomElement(HtmlElement) | Initializes the custom element of element, the element being created or upgraded. |
CustomElement(HtmlElement)
CustomElementConstructor.csInitializes the custom element of element, the element being created or upgraded.
protected CustomElement(HtmlElement element)Parameters
elementHtmlElement
Properties
| Name | Description |
|---|---|
| Element | Gets the element. |
Element
CustomElementConstructor.csMethods
| Name | Description |
|---|---|
| AdoptedCallback(Document, Document) | Called when the element is adopted into another document. |
| AttributeChangedCallback(string, string?, string?, string?) | Called when an attribute listed in CustomElementConstructor.ObservedAttributes is added, changed, removed or replaced. |
| ConnectedCallback() | Called when the element becomes connected. |
| ConnectedMoveCallback() | Called when the element is moved with moveBefore(). The default implementation calls CustomElement.DisconnectedCallback, then CustomElement.ConnectedCallback. |
| DisconnectedCallback() | Called when the element becomes disconnected. |
| FormAssociatedCallback(HtmlFormElement?) | Called when the form owner of a form-associated custom element changes. |
| FormDisabledCallback(bool) | Called when the disabled state of a form-associated custom element changes. |
| FormResetCallback() | Called when the form owner of a form-associated custom element is reset. |
| FormStateRestoreCallback(object?, string) | Called to restore the state of a form-associated custom element (mode is "restore" or "autocomplete"). The library never restores states. |
AdoptedCallback(Document, Document)
CustomElementConstructor.csAttributeChangedCallback(string, string?, string?, string?)
CustomElementConstructor.csConnectedCallback()
CustomElementConstructor.csCalled when the element becomes connected.
protected internal virtual void ConnectedCallback()ConnectedMoveCallback()
CustomElementConstructor.csCalled when the element is moved with moveBefore(). The default implementation calls CustomElement.DisconnectedCallback, then CustomElement.ConnectedCallback.
protected internal virtual void ConnectedMoveCallback()DisconnectedCallback()
CustomElementConstructor.csCalled when the element becomes disconnected.
protected internal virtual void DisconnectedCallback()FormAssociatedCallback(HtmlFormElement?)
CustomElementConstructor.csCalled when the form owner of a form-associated custom element changes.
protected internal virtual void FormAssociatedCallback(HtmlFormElement? form)Parameters
formHtmlFormElement?
FormDisabledCallback(bool)
CustomElementConstructor.csFormResetCallback()
CustomElementConstructor.csCalled when the form owner of a form-associated custom element is reset.
protected internal virtual void FormResetCallback()