Skip to content

Latest commit

 

History

History
14 lines (11 loc) · 477 Bytes

widget_with_options.md

File metadata and controls

14 lines (11 loc) · 477 Bytes

Widget < TOptions > Generic Class

If a widget requires some additional initialization options, it might be derived from the Widget< TOptions > class.

The options passed to the constructor can be accessed in class methods through the protected field options.

public abstract class Widget< TOptions > : Widget
    where TOptions: class, new()
{
    protected Widget(jQueryObject element, TOptions opt = null) { ... }
    protected readonly TOptions options;
}