Click or drag to resize

Style Class

Style manager for widgets
Inheritance Hierarchy
SystemObject
  EtoStyle

Namespace:  Eto
Assembly:  Eto (in Eto.dll) Version: 2.5.3-dev
Syntax
public static class Style

The Style type exposes the following members.

Properties
  NameDescription
Public propertyStatic memberProvider
Gets or sets the style provider.
Top
Methods
Events
  NameDescription
Public eventStatic memberStyleWidget
Event to handle when a widget has being styled
Top
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.
Examples
Style the widget, with no direct access to platform-specifics
Style.Add<Form>("mainForm", widget => {
    widget.Title = "Hello!";
});
Style based on a platform-specific handler (this is for Mac OS X):
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 ();
};
See Also

Reference