Class Button

Definition

Namespace:
ElmSharp
Assembly:
ElmSharp.dll
API Level:
preview

The Button is a widget that works as a clickable input element to trigger events.

C#
Copy
public class Button : Layout, IAccessibleObject
Inheritance
Implements

Constructors

View Source

Button(EvasObject)

Creates and initializes a new instance of the Button class.

Declaration
C#
Copy
public Button(EvasObject parent)
Parameters
Type Name Description
EvasObject parent

The EvasObject to which the new Button will be attached as a child.

API Level: preview

Properties

View Source

AutoRepeat

Sets or gets the autorepeat feature of a given Bbutton.

Declaration
C#
Copy
public bool AutoRepeat { get; set; }
Property Value
Type Description
System.Boolean
Remarks

Autorepeat feature means the autorepeat event is generated when the button is kept pressed. When set to false, no autorepeat is performed and the buttons will trigger the Clicked event when they are clicked. When set to true, keeping a button pressed continuously will trigger the Repeated event until the button is released. The time it takes until it starts triggering, repeated is given by AutoRepeatInitialTime, and the time between each new emission is given by AutoRepeatGapTimeout.

API Level: preview
View Source

AutoRepeatGapTimeout

Sets or gets the interval between each generated Repeat event.

Declaration
C#
Copy
public double AutoRepeatGapTimeout { get; set; }
Property Value
Type Description
System.Double
API Level: preview
View Source

AutoRepeatInitialTime

Sets or gets the initial timeout before the Repeat event is generated.

Declaration
C#
Copy
public double AutoRepeatInitialTime { get; set; }
Property Value
Type Description
System.Double
API Level: preview
View Source

BackgroundColor

Sets or gets the BackgroundColor of a given button in the normal and pressed status.

Declaration
C#
Copy
public override Color BackgroundColor { set; }
Property Value
Type Description
Color
Overrides
API Level: preview

Methods

View Source

CreateHandle(EvasObject)

Creates a widget handle.

Declaration
C#
Copy
protected override IntPtr CreateHandle(EvasObject parent)
Parameters
Type Name Description
EvasObject parent

Parent EvasObject.

Returns
Type Description
System.IntPtr

Handle IntPtr.

Overrides
API Level: preview
View Source

DeleteColorClass(String)

Deletes the object Color class.

Declaration
C#
Copy
[Obsolete("DeleteColorClass is obsolete, please use EdjeObject.DeleteColorClass(string)")] public void DeleteColorClass(string part)
Parameters
Type Name Description
System.String part

The Color class to be deleted.

API Level: preview

Events

View Source

Clicked

Clicked will be triggered when the button is clicked.

Declaration
C#
Copy
public event EventHandler Clicked
Event Type
Type Description
System.EventHandler
API Level: preview
View Source

Pressed

Pressed will be triggered when the button is pressed.

Declaration
C#
Copy
public event EventHandler Pressed
Event Type
Type Description
System.EventHandler
API Level: preview
View Source

Released

Released will be triggered when the button is released after being pressed.

Declaration
C#
Copy
public event EventHandler Released
Event Type
Type Description
System.EventHandler
API Level: preview
View Source

Repeated

Repeated will be triggered when the button is pressed without releasing it.

Declaration
C#
Copy
public event EventHandler Repeated
Event Type
Type Description
System.EventHandler
API Level: preview

Implements

Extension Methods