# Style class

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

```cs
public static class Style
```

Style manager for widgets

**Remarks:** Styles allow you to attach custom platform-specific logic to a widget. In your platform-specific assembly, use Style.Add<H>(string, StyleHandler<H>) to add the style logic with the same id. Typically, your styles will be added in your platform-specific executable, before your application is run.

**Example:**

Style the widget, with no direct access to platform-specifics

```cs
Style.Add<Form>("mainForm", widget => {
	widget.Title = "Hello!";
});
```

 Style based on a platform-specific handler (this is for Mac OS X):

```cs
Style.Add<Eto.Mac.Forms.FormHandler>("mainForm", handler => {
	handler.Control.CollectionBehavior |= NSWindowCollectionBehavior.FullScreenPrimary;
});
Style.Add<Eto.Mac.Forms.ApplicationHandler>("application", handler => {
	handler.EnableFullScreen ();
});

// create the UI (typically this is in your UI library, not in the platform-specific assembly)
var app = new Application {
	Style = "application";  // will apply the style here
};

app.Initialized += delegate {
	app.MainForm = new Form { Style = "mainForm" }; // apply the mainForm style
	app.MainForm.Show ();
};
```

## Properties

- [Provider](https://eto.picoe.ca/api/type/eto.style/provider.md): (static) Gets or sets the style provider.

## Methods

- [Add<THandler>](https://eto.picoe.ca/api/type/eto.style/add.md): (2 overloads, static) Adds a style for a widget handler

## Events

- [StyleWidget](https://eto.picoe.ca/api/type/eto.style/stylewidget.md): (static) Event to handle when a widget has being styled
