# Component

URL: https://docs.wisej.com/api/wisej.base/general/wisej.base.component

Version: 4.1
Namespace: **Wisej.Base**

Assembly: **Wisej.Framework** (4.1.0.0)

The base class for Wisej components that are not controls. Wisej components are still managed on the client and the server but are not present on the designer surface. Examples of wisej components are: menu items, image lists, tree nodes, list items.

- C# - VB.NET

```csharp
public class Component : IDisposable, IWisejComponent, IWisejSerializable, IUserData
```

```visual
Public Class Component
    Inherits IDisposable
    Implements IWisejComponent, IWisejSerializable, IUserData
```

## Constructors

### ![Instance member](/img/api/instance.png) Component()

Default constructor

### ![Instance member](/img/api/instance.png) Component(embedded)

Default constructor

| Name | Type | Description | **embedded** | [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) | Indicates whether the component is embedded in a parent component. Embedded components don't update themselves, instead their parent is in charge of updating the corresponding client widget. 

## Properties

### ![Instance member](/img/api/instance.png) HasUserData

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) : Checks if the [UserData](/api/wisej.base/general/wisej.base.component#userdata) dynamic object was created and has any value. (Default: `False` )

### ![Instance member](/img/api/instance.png) InClientEvent

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) : Returns true if the component is processing a client event.

### ![Instance member](/img/api/instance.png) IsDisposed

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) : Indicates that the component has been disposed. (Default: `False` )

### ![Instance member](/img/api/instance.png) UserData

[Object](https://docs.microsoft.com/dotnet/api/system.object) : Returns a dynamic object that can be used to store custom data in relation to this component.

Default value is {}.

## Methods

### ![Instance member](/img/api/instance.png) Call(function, args)

Runs the JavaScript *function* within the component's context in the browser.

| Parameter | Type | Description | **function** | [String](https://docs.microsoft.com/dotnet/api/system.string) | The name of the JavaScript function to execute. | **args** | [Object[]](https://docs.microsoft.com/dotnet/api/system.object) | The arguments to pass to the function. 

### ![Instance member](/img/api/instance.png) Call(function, callback, args)

Runs the JavaScript *function* within the component's context in the browser and returns the value to the *callback* method.

| Parameter | Type | Description | **function** | [String](https://docs.microsoft.com/dotnet/api/system.string) | The name of the JavaScript function to execute. | **callback** | [Action<Object>](https://docs.microsoft.com/dotnet/api/system.action-1) | Asynchronous callback method that receives the return value. | **args** | [Object[]](https://docs.microsoft.com/dotnet/api/system.object) | The arguments to pass to the function. 

### ![Instance member](/img/api/instance.png) CallAsync(function, args)

Asynchronously runs the JavaScript *function* within the component's context in the browser and returns an awaitable [Task](https://docs.microsoft.com/dotnet/api/system.threading.tasks.task) containing the value returned by the remote call.

| Parameter | Type | Description | **function** | [String](https://docs.microsoft.com/dotnet/api/system.string) | The name of the JavaScript function to execute. | **args** | [Object[]](https://docs.microsoft.com/dotnet/api/system.object) | The arguments to pass to the function. 

**Returns:**[Task<Object>](https://docs.microsoft.com/dotnet/api/system.threading.tasks.task-1) . An awaitable [Task](https://docs.microsoft.com/dotnet/api/system.threading.tasks.task) that represents the asynchronous operation.

### ![Instance member](/img/api/instance.png) Dispose()

Releases all resources used by the [Component](/api/wisej.base/general/wisej.base.component) .

### ![Protected member](/img/api/protected.png) Dispose(disposing)

Marks this component as disposed.

| Parameter | Type | Description | **disposing** | [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) | true when this method is called by the application rather than a finalizer. 

### ![Instance member](/img/api/instance.png) Eval(javaScript)

Runs the *javaScript* code within the component's context in the browser.

| Parameter | Type | Description | **javaScript** | [String](https://docs.microsoft.com/dotnet/api/system.string) | The JavaScript code to run on the client. 

### ![Instance member](/img/api/instance.png) Eval(javaScript, callback)

Runs the *javaScript* code within the component's context in the browser and returns the value to the *callback* method.

| Parameter | Type | Description | **javaScript** | [String](https://docs.microsoft.com/dotnet/api/system.string) | The JavaScript code to evaluate on the client. | **callback** | [Action<Object>](https://docs.microsoft.com/dotnet/api/system.action-1) | Asynchronous callback method that receives the return value. 

### ![Instance member](/img/api/instance.png) EvalAsync(javaScript)

Asynchronously runs the *javaScript* code within the component's context in the browser and returns an awaitable [Task](https://docs.microsoft.com/dotnet/api/system.threading.tasks.task) that contains the value returned by the remote call.

| Parameter | Type | Description | **javaScript** | [String](https://docs.microsoft.com/dotnet/api/system.string) | The JavaScript code to evaluate on the client. 

**Returns:**[Task<Object>](https://docs.microsoft.com/dotnet/api/system.threading.tasks.task-1) . An awaitable [Task](https://docs.microsoft.com/dotnet/api/system.threading.tasks.task) that represents the asynchronous operation.

### ![Protected member](/img/api/protected.png) Finalize()

Destructor dispose pattern.

### ![Protected member](/img/api/protected.png) InvokeFilter(data, type)

Invokes the [Filter](/api/wisej.core/interfaces/wisej.core.iwisejcomponent#filter) method.

| Parameter | Type | Description | **data** | [Object](https://docs.microsoft.com/dotnet/api/system.object) | Data passed to the filter implementation. | **type** | [String](https://docs.microsoft.com/dotnet/api/system.string) | Name of the filter being invoked. 

**Returns:**[Object](https://docs.microsoft.com/dotnet/api/system.object) .

### ![Protected member](/img/api/protected.png) OnAddReferences(list)

Returns a collection of referenced components or collection of components.

| Parameter | Type | Description | **list** | [IList](https://docs.microsoft.com/dotnet/api/system.collections.ilist) | List of referenced components or collection of components. 

### ![Protected member](/img/api/protected.png) OnWebEvent(e)

Processes the event from the client.

| Parameter | Type | Description | **e** | WisejEventArgs | Event arguments. 

### ![Protected member](/img/api/protected.png) OnWebRender(config)

Renders the client component.

| Parameter | Type | Description | **config** | [Object](https://docs.microsoft.com/dotnet/api/system.object) | Dynamic configuration object. 

### ![Protected member](/img/api/protected.png) OnWebUpdate(state)

Updates the client component using the state information.

| Parameter | Type | Description | **state** | [Object](https://docs.microsoft.com/dotnet/api/system.object) | Dynamic state object. 

### ![Instance member](/img/api/instance.png) Update()

Updates the component on the client.

## Events

### ![Instance member](/img/api/instance.png) Disposed

[EventHandler](https://docs.microsoft.com/dotnet/api/system.eventhandler) Fired when the component is disposed.

## Inherited By

| Name | Description | [BindableComponent](/api/wisej.web/general/wisej.web.bindablecomponent) | Extends [Component](/api/wisej.web/general/wisej.web.component) and enables the component to participated if data binding operations and have their own [DataBindings](/api/wisej.web/general/wisej.web.bindablecomponent#databindings) . | [Component](/api/wisej.web/general/wisej.web.component) | Extends [Component](/api/wisej.base/general/wisej.base.component) and enables the components to appear on the designer surface. | MessageBox | Displays a message box that can contain text, buttons, and symbols that inform and instruct the user. | [Timer](/api/wisej.web/other-components/wisej.web.timer) | Implements a timer that raises an event at user-defined intervals. | [DesktopTaskBarItem](/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritem) | Represents a component in theDesktop control's taskbar. | [DesktopTaskBarItemControl](/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritemcontrol) | Represents a component in theDesktop control's taskbar that can host anyControl . | [DesktopTaskBarItemDateTime](/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritemdatetime) | Represents a DateTime component in theDesktop control's taskbar. | Animation | Provides support for animating controls or windows using predefined animations definitions or custom animations in response to certain events. | ErrorProvider | Provides a user interface for indicating that a control on a form has an error associated with it. | [HelpTip](/api/wisej.web/extenders/wisej.web.helptip) | Represents a small rectangular pop-up window that displays a brief help text next to a control when it gets activated (focused). | JavaScript | Allows controls to execute javascript code. | Rotation | Add rotation capabilities along the X,Y,Z axis toControl controls. | [StyleSheet](/api/wisej.web/extenders/wisej.web.stylesheet) | Adds CSS styling to controls. | [ToolTip](/api/wisej.web/extenders/wisej.web.tooltip) | Represents a small rectangular pop-up window that displays a brief description of a control's purpose when the user rests the pointer on the control. | AlertBox | Displays an alert box that can contain an icon and text that inform and instruct the user. Alert boxes are not modal and can disappear automatically. | [Toast](/api/wisej.web/notifications/wisej.web.toast) | Displays a toast that can contain an icon and text. | [ComponentTool](/api/wisej.web/editors/wisej.web.componenttool) | Represent a tool widget that can be displayed inside another control. A tool widget is different from other child controls: it's displayed inside the parent's layout. For example, theForm control shows tool widgets inside the caption bar. When a tool widget is pressed, it fires the toolClicked event on the container. | ImageList | Provides methods to manage a collection of [Image](https://docs.microsoft.com/dotnet/api/system.drawing.image) objects. This class cannot be inherited. | [ColumnHeader](/api/wisej.web/lists-and-grids/listview/wisej.web.columnheader) | Displays a standard column header in aListView control. | [ImageColumnHeader](/api/wisej.web/lists-and-grids/listview/wisej.web.imagecolumnheader) | Displays an image column header in aListView control. | [CheckedMenuItem](/api/wisej.web/menus/wisej.web.checkedmenuitem) | Represents an individual menu item that is displayed within a [MainMenu](/api/wisej.web/menus/wisej.web.mainmenu) or [ContextMenu](/api/wisej.web/menus/wisej.web.contextmenu) and always shows a checkbox next to the label. | [ContextMenu](/api/wisej.web/menus/wisej.web.contextmenu) | Represents a context menu associated to aControl . | [LinkMenuItem](/api/wisej.web/menus/wisej.web.linkmenuitem) | Represents an individual menu item that is displayed within a [MainMenu](/api/wisej.web/menus/wisej.web.mainmenu) or [ContextMenu](/api/wisej.web/menus/wisej.web.contextmenu) rendered using the <a> link element to let the browser process the specified [HRef](/api/wisej.web/menus/wisej.web.linkmenuitem#href) URL. | [MainMenu](/api/wisej.web/menus/wisej.web.mainmenu) | Represents the main menu in a [Form](/api/wisej.web/menus/wisej.web.mainmenu) . | [Menu](/api/wisej.web/menus/wisej.web.menu) | Represents the base functionality for all menus. | [MenuItem](/api/wisej.web/menus/wisej.web.menuitem) | Represents an individual item that is displayed within a [MainMenu](/api/wisej.web/menus/wisej.web.mainmenu) or [ContextMenu](/api/wisej.web/menus/wisej.web.contextmenu) . | [StatusBarControl](/api/wisej.web/containers/statusbar/wisej.web.statusbarcontrol) | Represents a panel in aStatusBar control that can host any [Control](/api/wisej.web/containers/statusbar/wisej.web.statusbarcontrol#control) . | [StatusBarPanel](/api/wisej.web/containers/statusbar/wisej.web.statusbarpanel) | Represents a panel in aStatusBar control. | [ToolBarButton](/api/wisej.web/containers/toolbar/wisej.web.toolbarbutton) | Represents an item in theToolBar . | [TreeNode](/api/wisej.web/lists-and-grids/treeview/wisej.web.treenode) | Represents a node of aTreeView . 

## Implements

| Name | Description | [IUserData](/api/wisej.web/interfaces/wisej.web.iuserdata) | Provides access to the `UserData` and `Tag` properties associated to the component implementing this interface. | [IWisejComponent](/api/wisej.core/interfaces/wisej.core.iwisejcomponent) | All wisej components implement this interface. | [IWisejSerializable](/api/wisej.core/interfaces/wisej.core.iwisejserializable) | Allows an object to serialize itself.
