# WidgetHandler<TControl, 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<TControl, TWidget> : WidgetHandler<TWidget>, IControlObjectSource
```

Base platform handler for [Widget](https://eto.picoe.ca/api/type/eto.widget.md) objects that have a backing platform object

**Remarks:** This is the base class for platform handlers. It is used to help wire up events and provide base functionality of a widget.

**Type parameters:**

- `TControl`: Type of the platform-specific object
- `TWidget` (where Widget): Type of widget the handler is for

**Example:**

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

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

**Derived types:** [WidgetHandler<TControl, TWidget, TCallback>](https://eto.picoe.ca/api/type/eto.widgethandler-3.md)

## Properties

- [Connector](https://eto.picoe.ca/api/type/eto.widgethandler-2/connector.md): Gets a weak connector class to hook up events to the underlying control
- [Control](https://eto.picoe.ca/api/type/eto.widgethandler-2/control.md): Gets or sets the platform-specific control object
- [DisposeControl](https://eto.picoe.ca/api/type/eto.widgethandler-2/disposecontrol.md): Gets a value indicating that control should automatically be disposed when this widget is disposed
- [IControlObjectSource.ControlObject](https://eto.picoe.ca/api/type/eto.widgethandler-2/eto-icontrolobjectsource-controlobject.md): Gets the platform-specific control object
- [HasControl](https://eto.picoe.ca/api/type/eto.widgethandler-2/hascontrol.md): Gets a value indicating whether this instance has a [WidgetHandler<TControl, TWidget>.Control](https://eto.picoe.ca/api/type/eto.widgethandler-2/control.md) instance.

## Methods

- [CreateConnector](https://eto.picoe.ca/api/type/eto.widgethandler-2/createconnector.md): Creates the event connector for this control
- [CreateControl](https://eto.picoe.ca/api/type/eto.widgethandler-2/createcontrol.md): Creates the control if not already set.
- [Dispose](https://eto.picoe.ca/api/type/eto.widgethandler-2/dispose.md): Disposes this widget and the associated control if [WidgetHandler<TControl, TWidget>.DisposeControl](https://eto.picoe.ca/api/type/eto.widgethandler-2/disposecontrol.md) is `true`
- [GetControl](https://eto.picoe.ca/api/type/eto.widgethandler-2/getcontrol.md): (static) Gets the platform-specific control object of the specified widget using this handler

## Inherited Members

- From [WidgetHandler<TWidget>](https://eto.picoe.ca/api/type/eto.widgethandler-1.md): [Callback](https://eto.picoe.ca/api/type/eto.widgethandler-1/callback.md), [ID](https://eto.picoe.ca/api/type/eto.widgethandler-1/id.md), [NativeHandle](https://eto.picoe.ca/api/type/eto.widgethandler-1/nativehandle.md), [Widget](https://eto.picoe.ca/api/type/eto.widgethandler-1/widget.md), [AttachEvent](https://eto.picoe.ca/api/type/eto.widgethandler-1/attachevent.md), [DetachEvent](https://eto.picoe.ca/api/type/eto.widgethandler-1/detachevent.md), [Dispose](https://eto.picoe.ca/api/type/eto.widgethandler-1/dispose.md), [HandleEvent](https://eto.picoe.ca/api/type/eto.widgethandler-1/handleevent.md), [Initialize](https://eto.picoe.ca/api/type/eto.widgethandler-1/initialize.md), [IsEventHandled](https://eto.picoe.ca/api/type/eto.widgethandler-1/iseventhandled.md), [OnInitializeComplete](https://eto.picoe.ca/api/type/eto.widgethandler-1/oninitializecomplete.md), [UnhandleEvent](https://eto.picoe.ca/api/type/eto.widgethandler-1/unhandleevent.md)

## See Also

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