Table of Contents

Interface ITweakButton

Namespace
ToSic.Sxc.Edit.Toolbar
Assembly
ToSic.Sxc.dll

Experimental new API in v15.07 to improve how to configure the Ui of a button.

[PublicApi]
public interface ITweakButton

Remarks

Added in v15.07

Methods

Classes(string)

Set one or more classes on the button.

ITweakButton Classes(string value)

Parameters

value string

a string containing one or more CSS class names

Returns

ITweakButton

Color(string, NoParamOrder, string, string)

Set the color of this button. A color can be red, green or #FFCC66 as well as transparent colors such as #FFCC6699

ITweakButton Color(string color = null, NoParamOrder noParamOrder = default, string background = null, string foreground = null)

Parameters

color string

The main color parameter. Can contain two values, comma separated.

noParamOrder NoParamOrder
background string

Background color - will only take effect if the color was not set.

foreground string

Foreground color - will only take effect if the color was not set.

Returns

ITweakButton

Filter(object)

Add filter information to the button - usually when opening Data dialogs.

ITweakButton Filter(object value)

Parameters

value object

A string such as name=value or an anonymous object such as new { name = 27 }

Returns

ITweakButton

Filter(string, object)

Add filter information to the button - usually when opening Data dialogs.

ITweakButton Filter(string name, object value)

Parameters

name string

The name/key which comes before the =

value object

The value which comes after the =

Returns

ITweakButton

FormParameters(object)

Add form-parameters to the button - which are available in the data.parameters in formulas.

ITweakButton FormParameters(object value)

Parameters

value object

A string such as name=value or an anonymous object such as new { name = 27 }

Returns

ITweakButton

Remarks

Added in 16.02

FormParameters(string, object)

Add form-parameters to the button - which are available in the data.parameters in formulas.

ITweakButton FormParameters(string name, object value)

Parameters

name string

The name/key which comes before the =

value object

The value which comes after the =

Returns

ITweakButton

Remarks

Added in 16.02

Group(string)

Set what group the button is in. This is rarely used.

ITweakButton Group(string value)

Parameters

value string

the group name

Returns

ITweakButton

Icon(string)

Set the icon for this button.

ITweakButton Icon(string value)

Parameters

value string

One of a few predefined names, or a SVG string.

Returns

ITweakButton

Note(string, NoParamOrder, string, string, int, int, string)

Add a floating note to the button.

ITweakButton Note(string note = null, NoParamOrder noParamOrder = default, string type = null, string background = null, int delay = 0, int linger = 0, string format = null)

Parameters

note string

The note/message

noParamOrder NoParamOrder

see Convention: Named Parameters

type string

Optional type, like info (default), warning, help

background string

Background color.

delay int

Delay show by this duration in ms. If mouse leaves before, it won't appear (new v17).

linger int

Linger by this duration in ms after the mouse leaves - new v17.

format string

html or text (default) - new v17

Returns

ITweakButton

Remarks

  • Added in v15.07
  • delay and linger added in v17
  • format added in v17

Parameters(object)

Add parameters to the button - which are usually used when executing the command.

Tip

These parameters are used in the page itself and not forwarded to the form. Use FormParameters(object) for that purpose.

ITweakButton Parameters(object value)

Parameters

value object

A string such as name=value or an anonymous object such as new { name = 27 }

Returns

ITweakButton

Parameters(string, object)

Add parameters to the button - which are usually used when executing the command.

Tip

These parameters are used in the page itself and not forwarded to the form. Use FormParameters(object) for that purpose.

ITweakButton Parameters(string name, object value)

Parameters

name string

The name/key which comes before the =

value object

The value which comes after the =

Returns

ITweakButton

Position(int)

Specify the position of the button. 0 means in the very front, 1 is right after the first button, etc. -1 means the last button, -2 is the second last, etc.

ITweakButton Position(int value)

Parameters

value int

Returns

ITweakButton

Prefill(object)

Add prefill information to the button, usually for creating new Entities.

ITweakButton Prefill(object value)

Parameters

value object

A string such as name=value or an anonymous object such as new { name = 27 }

Returns

ITweakButton

Prefill(string, object)

Add prefill information to the button, usually for creating new Entities.

ITweakButton Prefill(string name, object value)

Parameters

name string

The name/key which comes before the =

value object

The value which comes after the =

Returns

ITweakButton

Show(bool)

Set the show of this button.

ITweakButton Show(bool show = true)

Parameters

show bool

Optional show value, default is true

Returns

ITweakButton

Tooltip(string)

Set the title / Tooltip of the button.

ITweakButton Tooltip(string value)

Parameters

value string

The title/tooltip to show

Returns

ITweakButton

Ui(object)

Add a general ui-rule for things which are not in the standard API.

ITweakButton Ui(object value)

Parameters

value object

a string such as this=that or an object which will be parsed/serialized such as new { this = 27 }

Returns

ITweakButton

Ui(string, object)

Add a general UI rule for things which are not in the standard API.

ITweakButton Ui(string name, object value)

Parameters

name string

The name/key which comes before the =

value object

The value which comes after the =

Returns

ITweakButton