Class Button

Definition

Namespace:
Tizen.NUI.UIComponents
Assembly:
Tizen.NUI.dll

The Button class is a base class for different kinds of buttons.
This class provides the disabled property and the clicked signal.
The clicked event handler is emitted when the button is touched, and the touch point doesn't leave the boundary of the button.
When the disabled property is set to true, no signal is emitted.
The 'Visual' describes not just traditional images like PNG and BMP, but also refers to whatever is used to show the button. It could be a color, gradient, or some other kind of renderer.
The button's appearance can be modified by setting properties for the various visuals or images.
It is not mandatory to set all the visuals. A button could be defined only by setting its background visual, or by setting its background and selected visuals.
The button visual is shown over the background visual.
When pressed, the unselected visuals are replaced by the selected visuals.
The text label is always placed on the top of all images.
When the button is disabled, the background button and the selected visuals are replaced by their disabled visuals.

C#
Copy
public class Button : View, INotifyPropertyChanged, IDisposable
Inheritance
object
Tizen.NUI.Binding.BindableObject
Tizen.NUI.Binding.Element
Button
Derived
Implements
System.ComponentModel.INotifyPropertyChanged
System.IDisposable

Constructors

View Source

Button()

Creates an uninitialized button.
Only the derived versions can be instantiated.

Declaration
C#
Copy
public Button()

Properties

View Source

AutoRepeating

If the autorepeating property is set to true, then the togglable property is set to false.

Declaration
C#
Copy
public bool AutoRepeating { get; set; }
Property Value
Type Description
bool
View Source

DisabledSelectedBackgroundVisual

Gets or sets the disabled while selected background button visual.

Declaration
C#
Copy
public PropertyMap DisabledSelectedBackgroundVisual { get; set; }
Property Value
Type Description
PropertyMap
View Source

DisabledSelectedVisual

Gets or sets the disabled selected state foreground or icon button visual.

Declaration
C#
Copy
public PropertyMap DisabledSelectedVisual { get; set; }
Property Value
Type Description
PropertyMap
View Source

DisabledUnselectedBackgroundVisual

Gets or sets the disabled while unselected background button visual.

Declaration
C#
Copy
public PropertyMap DisabledUnselectedBackgroundVisual { get; set; }
Property Value
Type Description
PropertyMap
View Source

DisabledUnselectedVisual

Gets or sets the disabled unselected state foreground or icon visual.

Declaration
C#
Copy
public PropertyMap DisabledUnselectedVisual { get; set; }
Property Value
Type Description
PropertyMap
View Source

ForegroundVisualPadding

Gets or sets the padding around the foreground visual.

Declaration
C#
Copy
public Vector4 ForegroundVisualPadding { get; set; }
Property Value
Type Description
Vector4
View Source

InitialAutoRepeatingDelay

By default, this value is set to 0.15 seconds.

Declaration
C#
Copy
public float InitialAutoRepeatingDelay { get; set; }
Property Value
Type Description
float
View Source

Label

Gets or sets the label.

Declaration
C#
Copy
public PropertyMap Label { get; set; }
Property Value
Type Description
PropertyMap
View Source

LabelPadding

Gets or sets the padding around the text.

Declaration
C#
Copy
public Vector4 LabelPadding { get; set; }
Property Value
Type Description
Vector4
View Source

LabelRelativeAlignment

Gets or sets the position of the the label in relation to the foreground or icon, if both present.

Declaration
C#
Copy
public Button.Align LabelRelativeAlignment { get; set; }
Property Value
Type Description
Button.Align
View Source

LabelText

Gets or sets the text of the label.

Declaration
C#
Copy
public string LabelText { get; set; }
Property Value
Type Description
string
View Source

NextAutoRepeatingDelay

By default, this value is set to 0.05 seconds.

Declaration
C#
Copy
public float NextAutoRepeatingDelay { get; set; }
Property Value
Type Description
float
View Source

Selected

Gets or sets the togglable button as either selected or unselected, togglable property must be set to true.

Declaration
C#
Copy
public bool Selected { get; set; }
Property Value
Type Description
bool
View Source

SelectedBackgroundVisual

Gets or sets the selected background button visual.

Declaration
C#
Copy
public PropertyMap SelectedBackgroundVisual { get; set; }
Property Value
Type Description
PropertyMap
View Source

SelectedColor

Gets or sets the selected color.

Declaration
C#
Copy
public Color SelectedColor { get; set; }
Property Value
Type Description
Color
View Source

SelectedVisual

Gets or sets the selected button foreground or icon visual.

Declaration
C#
Copy
public PropertyMap SelectedVisual { get; set; }
Property Value
Type Description
PropertyMap
View Source

Togglable

If the togglable property is set to true, then the autorepeating property is set to false.

Declaration
C#
Copy
public bool Togglable { get; set; }
Property Value
Type Description
bool
View Source

UnselectedBackgroundVisual

Gets or sets the disabled unselected state background button visual.

Declaration
C#
Copy
public PropertyMap UnselectedBackgroundVisual { get; set; }
Property Value
Type Description
PropertyMap
View Source

UnselectedColor

Gets or sets the unselected color.

Declaration
C#
Copy
public Color UnselectedColor { get; set; }
Property Value
Type Description
Color
View Source

UnselectedVisual

Gets or sets the unselected button foreground or icon visual.

Declaration
C#
Copy
public PropertyMap UnselectedVisual { get; set; }
Property Value
Type Description
PropertyMap

Methods

View Source

Dispose(DisposeTypes)

To dispose the button instance.

Declaration
C#
Copy
protected override void Dispose(DisposeTypes type)
Parameters
Type Name Description
DisposeTypes type
Overrides

Events

View Source

Clicked

The Clicked event will be triggered when the button is touched and the touch point doesn't leave the boundary of the button.

Declaration
C#
Copy
public event EventHandlerWithReturnType<object, EventArgs, bool> Clicked
Event Type
Type Description
EventHandlerWithReturnType<object, System.EventArgs, bool>
View Source

Pressed

The Pressed event will be triggered when the button is touched.

Declaration
C#
Copy
public event EventHandlerWithReturnType<object, EventArgs, bool> Pressed
Event Type
Type Description
EventHandlerWithReturnType<object, System.EventArgs, bool>
View Source

Released

The Released event will be triggered when the button is touched and the touch point leaves the boundary of the button.

Declaration
C#
Copy
public event EventHandlerWithReturnType<object, EventArgs, bool> Released
Event Type
Type Description
EventHandlerWithReturnType<object, System.EventArgs, bool>
View Source

StateChanged

The StateChanged event will be triggered when the button's state is changed.

Declaration
C#
Copy
public event EventHandlerWithReturnType<object, EventArgs, bool> StateChanged
Event Type
Type Description
EventHandlerWithReturnType<object, System.EventArgs, bool>

Implements

System.ComponentModel.INotifyPropertyChanged
System.IDisposable