# WidgetHandler<TWidget> class

Namespace: [Eto](https://eto.picoe.ca/api/namespace/eto.md) · Assembly: [Eto](https://eto.picoe.ca/api/assembly/eto.md)

```cs
public abstract class WidgetHandler<TWidget> : Widget.IHandler, IDisposable
```

Base platform handler for widgets

**Remarks:** This is the base class for platform handlers. It is used to help wire up events and provide base functionality of a widget. If you are creating an InstanceWidget, you should use [WidgetHandler<T, W>](https://eto.picoe.ca/api/type/eto.widgethandler-2.md).

**Type parameters:**

- `TWidget` (where Widget): Type of widget the handler is for

**Example:**

This example shows how to implement a platform handler for a widget called StaticWidget

```cs
// override the class and implement widget-specific interface
public MyStaticWidgetHandler : WidgetHandler<StaticWidget>, IStaticWidget
{
	// implement IStaticWidget's properties and methods
}
```

**Derived types:** [ThemedMessageBoxHandler](https://eto.picoe.ca/api/type/eto.forms.themedcontrols.themedmessageboxhandler.md), [WidgetHandler<TControl, TWidget>](https://eto.picoe.ca/api/type/eto.widgethandler-2.md)

## Properties

- [Callback](https://eto.picoe.ca/api/type/eto.widgethandler-1/callback.md): Gets the callback object for the control
- [Widget.IHandler.Widget](https://eto.picoe.ca/api/type/eto.widgethandler-1/eto-widget-ihandler-widget.md): Gets or sets the widget instance
- [ID](https://eto.picoe.ca/api/type/eto.widgethandler-1/id.md): Gets or sets the ID of this widget
- [NativeHandle](https://eto.picoe.ca/api/type/eto.widgethandler-1/nativehandle.md): Gets the native platform-specific handle for integration purposes
- [Widget](https://eto.picoe.ca/api/type/eto.widgethandler-1/widget.md): Gets the widget that this platform handler is attached to

## Methods

- [AttachEvent](https://eto.picoe.ca/api/type/eto.widgethandler-1/attachevent.md): Attaches the specified event to the platform-specific control
- [DetachEvent](https://eto.picoe.ca/api/type/eto.widgethandler-1/detachevent.md): Detaches an event from the platform-specific control, undoing [WidgetHandler<TWidget>.AttachEvent(string)](https://eto.picoe.ca/api/type/eto.widgethandler-1/attachevent.md).
- [Dispose](https://eto.picoe.ca/api/type/eto.widgethandler-1/dispose.md): (2 overloads) Disposes this object
- [Widget.IHandler.Initialize](https://eto.picoe.ca/api/type/eto.widgethandler-1/eto-widget-ihandler-initialize.md)
- [HandleEvent](https://eto.picoe.ca/api/type/eto.widgethandler-1/handleevent.md): Called to handle a specific event
- [Initialize](https://eto.picoe.ca/api/type/eto.widgethandler-1/initialize.md): Called to initialize this widget after it has been constructed
- [IsEventHandled](https://eto.picoe.ca/api/type/eto.widgethandler-1/iseventhandled.md): Gets a value indicating that the specified event is handled
- [OnInitializeComplete](https://eto.picoe.ca/api/type/eto.widgethandler-1/oninitializecomplete.md): Called after initialization is complete
- [UnhandleEvent](https://eto.picoe.ca/api/type/eto.widgethandler-1/unhandleevent.md): Called when the last subscriber to an event has been removed, giving [WidgetHandler<TWidget>.DetachEvent(string)](https://eto.picoe.ca/api/type/eto.widgethandler-1/detachevent.md) the chance to stop listening for it.

## See Also

- [WidgetHandler<T, W>](https://eto.picoe.ca/api/type/eto.widgethandler-2.md)
