public static TWidget AddDrawHandler <TWidget>(this TWidget widget, WidgetEventHandler <Widget> handler) where TWidget : Widget { CheckNotNull(widget); widget.Behaviors.GetOrAdd <CommonEventsBehavior>().Draw += handler; return(widget); }
public static TWidget AddTextChangedHandler <TWidget>(this TWidget widget, WidgetEventHandler <TextField> handler) where TWidget : TextField { CheckNotNull(widget); widget.TextChanged += handler; return(widget); }
public static TWidget AddValueChangedHandler <TWidget>(this TWidget widget, WidgetEventHandler <ScrollBar> handler) where TWidget : ScrollBar { CheckNotNull(widget); widget.ValueChanged += handler; return(widget); }
public static TWidget AddPressedHandler <TWidget>(this TWidget widget, WidgetEventHandler <Button> handler) where TWidget : Button { CheckNotNull(widget); widget.Pressed += handler; return(widget); }
public static TWidget AddCloseButtonPushedHandler <TWidget>(this TWidget widget, WidgetEventHandler <MainWindow> handler) where TWidget : MainWindow { CheckNotNull(widget); widget.CloseButtonPushed += handler; return(widget); }
protected static void Raise <T>(WidgetEventHandler <T> handler, WidgetEvent evt, T e) => EventHelper.InvokeStrict(() => handler, d => ((WidgetEventHandler <T>)d)(evt, e));